Expires directive and try_files rewrites not working

Maxim Dounin mdounin at mdounin.ru
Wed Dec 2 21:47:21 MSK 2009


Hello!

On Wed, Dec 02, 2009 at 01:22:01PM -0500, Per Hansson wrote:

> Hi, I am trying to use the try_files directive for rewrites together with the Expires directive but when I do file extensions which are included by the expires directive are ignored by my try_files directive, it seems like they are served directly...
> 
> Here is an example config; http://pastebin.com/m4c4819a0
> Note that files named .js are included in the expires directive and that URL's that have "phpAdsNew" in them should get rewritten to "openxads", example URL; http://www.techspot.com/phpAdsNew/adx.js (it returns 404 with the pastebinned config)
> 
> Is this by design or am I just doing it wrong?

http://wiki.nginx.org/NginxHttpCoreModule#location

In short: only *one* location matches particular query, and only 
*one* configuration will be used.  Don't expect any merging magic.

Maxim Dounin




More information about the nginx mailing list