1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using Tomato RAF's NGINX web server to replace pixelserv for ad blocking

Discussion in 'Tomato Firmware' started by RonV, Aug 4, 2013.

  1. RonV

    RonV Network Guru Member

    There has been a lot of issues with folks running pixelserv for removing ads from web sites. I was able to use the NGNIX in the Tomato RAF from Victek by doing these few steps:

    Setting up web server in Tomato RAF for AD Blocking

    1) Set the default port for the native RAF management to 8080 or something else besides 80
    • Administration > Admin Access > Web Admin > HTTP Port set > 8080
    • save
    2) Reconnect to management page using your router ip:8080

    3) Create a web root for NGINX

    • I used a USB drive for the new web pages mine is mounted on /tmp/mnt/sda1
    • create a 'www' directory in the root of the USB drive
    • cp from /www/* to /tmp/mnt/sda1/www/* - makes a copy of the web pages used to manage RAF
    • copy the code below and paste into /tmp/mnt/sda/www/404.html - custom page not found error page
    HTML:
    <HTML>
    <HEAD><TITLE>Ad-Blocked Page</TITLE></HEAD>
    <BODY bgcolor="white">
    <IMG WIDTH="1" HEIGHT="1" SRC="white_pixel.gif">
    </BODY>
    </HTML>
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->
    <!-- a padding to disable MSIE and Chrome friendly error page -->

    • copy the attached white_pixel.gif to the /tmp/mnt/sda1/wwww/white_pixel.gif - 2 pixel image for the 404.html page
    4) Enable the web server in RAF
    • Web Server > Check Enable
    • Web Server > Web Server Port > 80
    • Web Server > Server Root Path /tmp/mnt/sda1/www
    • leave the rest defaults
    • save
    5) Verify web server
    • Check log to make sure the NGINX server started
    • test a url http://<ipaddress of router> - should display a NGINX sample page
    • test a url http://<ipaddress of router>/dummy.html - should display a white page
    You have successfully created a pixelserv replacement. Now all that needs to be done is to make sure your favorite DNS poisoning AD block script uses the IP address of your router when it creates the DNSMASQ entries.
     

    Attached Files:

    irouy, Image This, mmosoll and 3 others like this.

Share This Page