Personal HTTP Proxy using squid with Oracle Cloud VPS

Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL. 

1. Install squid and other useful packages

sudo apt-get install squid cron rsyslog logrotate dnsutils nano

2. Modify /etc/squid/squid.conf with below settings.

http_port 3128
http_access allow all
#http_access deny all

3. Restart squid service with the new settings.

sudo systemctl restart squid

4. Allow incoming 3128 port in iptables firewall rule.

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

5. To secure your squid 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 3128 -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 3128 (ingress rules) on the Oracle Cloud's VPS/Virtual Cloud Network (VCN).

8. Configure manual proxy in your browser like Firefox.

Comments