Re: [squid-users] Serve JSON object on access denial?

From: Amos Jeffries <squid3@dont-contact.us>
Date: Fri, 07 Mar 2008 21:46:18 +1300

Dimitry Golubovsky wrote:
> Hi,
>
> Is there any way to make Squid serve a JSON object when access to some
> proxied resource is denied?
>
> I use Squid as a reverse proxy to control access to CouchDB database
> (which by itself does not have any access control yet). In the case of
> error, CouchDB serves a specifically-formatted JSON object. I would
> like to be able to serve a similar JSON object (with content-type
> "application/json") if the proxy denies access, instead of a HTML
> page.

In 2.6+ and 3.0+ you can point deny_info at any URL you like. Including
a script that produces JSON objects and the appropriate HTTP mime
headers for them. Whatever they are.

Amos

-- 
Please use Squid 2.6STABLE17+ or 3.0STABLE1+
There are serious security advisories out on all earlier releases.
Received on Fri Mar 07 2008 - 01:45:43 MST

This archive was generated by hypermail pre-2.1.9 : Tue Apr 01 2008 - 13:00:05 MDT