Personal HTTP Proxy using privoxy with Oracle Cloud VPS

Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk. Privoxy has a flexible configuration and can be customized to suit individual needs and tastes. It has application for both stand-alone systems and multi-user networks.

1. Install privoxy and other useful packages.

sudo apt-get install privoxy cron rsyslog logrotate dnsutils nano

2. Edit /etc/privoxy/config to change the listening network and port setting to allow all.

listen-address 0.0.0.0:8118 

3. Restart the privoxy service.

sudo systemctl restart privoxy

4. Allow incoming 8118 port in iptables firewall rule.

-A INPUT -p tcp -m state --state NEW --dport 8118 -j ACCEPT

5. To secure your personal HTTP proxy service, configure your iptables rules to only incoming access from your own public IP.

-A INPUT -p tcp -m state --state NEW -m tcp --dport 8118 -s xxx.xxx.xxx.xxx -j ACCEPT

6. For those who only have dynamic public IP, follow this guide to dynamic update the iptables rules using cron and ddns service.

7. Remember to allow port 8118 (ingress rules) on the Oracle Cloud's VPS/Virtual Cloud Network (VCN).

8. Configure manual proxy in your browser like Firefox.

 

9. By default, privoxy will not log data to logfile. To enable logging, enable debug in /etc/privoxy/config.

debug      1 # Log the destination for each request Privoxy let through.
debug   1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
debug   4096 # Startup banner and warnings
debug   8192 # Non-fatal errors

10. By default, privoxy will enable some ads-blocking. To disable it, replace /etc/privoxy/user.action with below configuration. Restart privoxy service with the new settings.

# Unblock everybody, everywhere
 { -block }
 / # UN-Block *all* URLs

Or even a more comprehensive reversing of various ad related actions:

{{alias}}
allow popups = -filter{all-popups} -filter{unsolicited-popups}

# Unblock everybody, everywhere, and turn off appropriate filtering, etc
{ -block \
-filter{banners-by-size} \
-filter{banners-by-link} \
allow-popups \
}
/ # UN-Block *all* URLs and allow ads


Comments