Random Error Pages to be served using nginx

Harish Sundararaj tuxtoti at gmail.com
Sat Dec 12 22:11:56 MSK 2009

Hi all,

I'm looking for a way to serve random error pages for 504/502 errors.
In addition i also want  the error pages to be served based on the

Something like this:
1) When this URL is requested:  http://mydomain.com/search?type=ABC
 and if the proxy returns a 504 or 502 and when the GET parameter 'type' has
'ABC' as value then serve
any random document  from "/path/to/custom/error/typeABC/"

2) and the same applies to http://mydomain.com/search?type=DEF just that the
directory to be used to serve
error document should be "/path/to/custom/error/typeDEF"

I'm sure this can be achieved with named locations and probably try_files.
But I'm just not able to get anything working.

Would appreciate some pointers.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20091213/b159f3a9/attachment.html>

More information about the nginx mailing list