Hi all, <div><br>I&#39;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 &#39;type&#39; has &#39;ABC&#39; as value then serve</div><div>any random document  from &quot;/path/to/custom/error/typeABC/&quot;</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 &quot;/path/to/custom/error/typeDEF&quot;</div>
<div><br></div><div>I&#39;m sure this can be achieved with named locations and probably try_files. But I&#39;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>