Solved

Squid - Custom Error Pages

Posted on 2013-02-05
5
93 Views
Last Modified: 2016-03-13
Hi all,

Currently have multiple domains being served by a reverse proxy on squid - I need to add config on my current squid server to display different error pages depending on the domain requested.


:)
0
Comment
Question by:ddiazp
  • 2
5 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 38859427
Usually custom errors are part on the systems to which the data/requests are passed.

If the reverse proxy secures a web server, the custom error configuration will be on the web server.
Could you provide an example of a request and the error message you would like to see on the client?
0
 
LVL 10

Author Comment

by:ddiazp
ID: 38859612
On my squid config i have the following line:

error_directory /usr/share/squid/errors/templates/error_templates

and under /usr/share/squid/errors/templates/error_templates I have an .html page that shows up when the end web server doesn't respond (timesout, etc.). and this shows for any request on any of the test1.com, test2.com, test3.com domains that I cache.


What i'd like is to have something on my main squid.conf file that will point to a specific 'error_directory' directive depending on what's accessed:

something like:

if user requests: www.test1.com then error_directory /path/to/test1/errorpage/
if user requests: www.test2.com then error_directory /path/to/test2/errorpage/
if user requests: www.test3.com then error_directory /path/to/test3/errorpage/

and so on.
0
 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 38860301
Have a look at http://wiki.squid-cache.org/Features/CustomErrors depending on your installed squid version

Your local apache setup could be the backup to display the sorry we are temporarily unavailable.

I.e. primarily test1.com -> 10.0.0.2 when down return something site specific error.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to moveā€¦
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now