Hi all, <div><br>I'm looking for a way to serve random error pages for 504/502 errors.
<div>In addition i also want the error pages to be served based on the $request_uri.</div><div><br></div><div>Something like this:</div><div>1) When this URL is requested: <a href="http://mydomain.com/search?type=ABC">http://mydomain.com/search?type=ABC</a></div>
<div> and if the proxy returns a 504 or 502 and when the GET parameter 'type' has 'ABC' as value then serve</div><div>any random document from "/path/to/custom/error/typeABC/"</div><div><br></div>
<div>2) and the same applies to <a href="http://mydomain.com/search?type=DEF">http://mydomain.com/search?type=DEF</a> just that the directory to be used to serve</div><div>error document should be "/path/to/custom/error/typeDEF"</div>
<div><br></div><div>I'm sure this can be achieved with named locations and probably try_files. But I'm just not able to get anything working.</div><div><br></div><div>Would appreciate some pointers.</div><div><br>
</div><div>Regards</div><div>Harish</div></div>