Configure Squid as a Reverse Proxy

Configure Squid as a Reverse Proxy

Configure Squid as a Reverse Proxy

This article goes over configuring squid as a reverse proxy.  A reverse proxy can be useful for web hosting if you have multiple servers hosting the same website you may want to have it balanced with a reverse proxy. This also adds a few layers of security, as well as allows traffic to be allowed/denied as needed.

Let’s get started, login, and su to root

yum -y install squid on the squid reverse proxy server

Install the squid package

Same screenshot: yum -y install squid to install the proxy package

set the service to run on startup, and start the service

chkconfig squid on and service squid start, Starting squid OK

set the hostname via /etc/hosts

/etc/hosts with localhost entries and an ipaddress hostname.domain.local line

make a backup of the original squid config (trust me you want to do this step)

cp /etc/squid/squid.conf /etc/squid/squid.conf.bk backup copy

from here append line 59 to have http_access allow all

squid.conf line 59 http_access allow all above http_access deny all

from here comment out line 63, and add line 64

squid.conf line 63 #http_port 3128 commented out, line 64 http_port 80 defaultsite=ipaddress

add the following line to the bottom of the config:

squid.conf cache_peer ipaddress parent 80 0 no-query originserver

restart squid once completed

service squid restart, Stopping and Starting squid OK

now if you visit the IP address of the proxy server, you will be redirected to the HTTP Server

Backend web site served through the Squid reverse proxy IP address

That’s it! You have successfully configured Squid as a reverse proxy server.

To configure a Load-Balanced Reverse Proxy, click here

Hosted Linux Servers at www.zwiegnet.com/go

Leave a Reply

Your email address will not be published. Required fields are marked *