Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

Understanding location blocks and try files (6 replies)

$
0
0
Hi,

I'm trying to understand a problem I'm facing in a typical frontend-controller application.

I've setup a test config with a single simple server [1], and ran a test script with debugging enabled to show what happens [2].


What confuses me is why this example is a 404:

> curl -i http://nginx.dev/apples.json
> HTTP/1.1 404 Not Found
> Server: nginx/1.4.4

As can be seen in the log [3] there is an invalid response from /index.php. If I disable the location block adding cache headers for json files [4] though, the response is fine.

Can someone shed some light as to why this happens? Is there a way to define location blocks for static files - without that causing problems for dynamic requests for the same url pattern?

Any help appreciated,

Cheers,

AD

[1] https://github.com/AD7six/server-configs-nginx
[2] https://gist.github.com/AD7six/eafe7cc6fc655c3195c4
[3] https://gist.github.com/AD7six/eafe7cc6fc655c3195c4#file-error-log-L424
[4] https://github.com/AD7six/server-configs-nginx/blob/location-debug/h5bp/location/expires.conf#L12

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>