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.