Currently I am trying to configure my squid (3.1) reverse proxy to always display a static webpage when the one and only backend webserver is under maintenance. There is no need for an automatic switchover. The maintenance mode shall be activated by a manual config change.
The squid docs and wiki were not really helpful on this point.
My idea was to block every request and display a static webpage as a deny_info
with a 200 status code like so:
acl everyone src 0.0.0.0/0.0.0.0
## Testing with my client ip address:
# acl everyone src 10.123.0.40/32
http_access deny everyone
deny_info 200:/etc/squid/maintenance.html everyone
I placed that snippet before any other http_access
rule and tried that configuration by only blocking my own clients traffic but there was no effect using squid -k reconfigure
. It may work when I use sudo service squid restart
but I do not want to test it right now because at the time there a many users using that service and a squid restart takes about half a minute (for every test).
My questions:
- Is that configuration correct for that purpose?
- Do I need to use
sudo service squid restart
for the changes to take effect or is there simply something wrong? - Is there a better solution to display a static maintenance page?
Thanks in advance.