Ubuntu 18.04
Sponsored Link

Squid : Configure as Reverse Proxy2018/05/15

 
Configure Squid as a reverse proxy server.
[1]
[2] Configure Squid.
root@prox:~#
vi /etc/squid/squid.conf
# line 1192: add (allow http access all)

http_access allow all
# line 1611: change like follows (specify backend Web server for defaultsite)

#
http_port 3128
http_port 80 accel defaultsite=www.srv.world
https_port 443 accel defaultsite=www.srv.world cert=/etc/letsencrypt/live/prox.srv.world/fullchain.pem key=/etc/letsencrypt/live/prox.srv.world/privkey.pem
# line 3039: add

cache_peer www.srv.world parent 80 0 no-query originserver
# line 3190: add (memory cache size)

cache_mem 256 MB
# line 3462: add

# number means ⇒ [disk cache size] [number of directories on top level] [number of directories on 2nd level]

cache_dir ufs /var/spool/squid 256 16 256
# line 5595: add (define hostname)

visible_hostname prox.srv.world
root@prox:~#
systemctl restart squid
[3] Change DNS or Router's settings if need, and make it listen HTTP/HTTPS requests on Squid server. It's OK if backend http server responds like follows.
Matched Content