Re: [squid-users] Reverse Proxy custom 404/500 pages for each site?

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 16 May 2013 23:54:04 +1200

On 16/05/2013 9:11 p.m., Martin Sperl wrote:
> I had a similar issue just recently...
>
> The only option I found is that you can use deny_info and send a redirect to a "different" URL for those error cases you are interested in.
>
> Like this: deny_info http://<hostname>/%H/error-icap.html ERROR_ICAP
>
> Then you have to have an Apache or similar listening on the <hostname> of your choice to deliver the "error page" you are interested in...
>
> Ciao,
> Martin

Or alternatively make siteone.404.html contain:

<iframe src="http://%H/error-icap.html"></iframe>

Which will still propigate the 404 status code to the client and make
them display the per-site content.

Amos

>
> -----Original Message-----
> From: PSA4444 [mailto:sima_yi_at_operamail.com]
> Sent: Donnerstag, 16. Mai 2013 08:40
> To: squid-users_at_squid-cache.org
> Subject: [squid-users] Reverse Proxy custom 404/500 pages for each site?
>
> I have setup Squid as a reverse proxy with more than 10 websites behind it.
>
> I am using custom 404 and 500 error pages which are shown, regardless of
> which site is being accessed.
>
> Is there a way I can target each site with a specific 404 page?
>
> So in the example config below, I would like 'siteone' to have 'this link on
> siteone is down' and site two to have 'this pages does not exist on
> sitetwo', etc.
>
> ---
> Config:
>
> #Top of the config file
> acl denied_status_404 http_status 404
> acl denied_status_500 http_status 500
>
>
> #(Pages are defined here, such as):
> #SITEONE API
> cache_peer api.siteone.com parent 443 0 no-query originserver ssl
> sslversion=3 sslflags=DONT_VERIFY_PEER front-end-https=on name=api
> login=PASSTHRU
> acl sites_api dstdomain api.siteone.com
> cache_peer_access api allow sites_api serviceHours1
> cache_peer_access api allow sites_api serviceHours2
> cache_peer_access api deny sites_jarc publicall
> acl http proto http
> acl https proto https
>
> #SITETWO
> #PRODUCTION W3
> cache_peer www.sitetwo.com parent 80 0 no-query originserver name=www
> acl sites_www dstdomain www.sitetwo.com sitetwo.com
> cache_peer_access www allow sites_www
> acl http proto http
> acl https proto https
>
>
> #Bottom of the config file:
> deny_info siteone.404.html denied_status_404
> http_reply_access deny denied_status_404
> deny_info siteone.500.html denied_status_500
> http_reply_access deny denied_status_500
>
> ---
> Squid Cache: Version 3.2.1
>
>
>
> --
> View this message in context: http://squid-web-proxy-cache.1019090.n4.nabble.com/Reverse-Proxy-custom-404-500-pages-for-each-site-tp4660050.html
> Sent from the Squid - Users mailing list archive at Nabble.com.
>
> This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
> you may review at http://www.amdocs.com/email_disclaimer.asp
Received on Thu May 16 2013 - 11:54:28 MDT

This archive was generated by hypermail 2.2.0 : Thu May 16 2013 - 12:00:06 MDT