4

nginx - request getting handled by multiple location blocks

view full story
linux-howto

http://serverfault.com – I'm testing a setup where I'd like to have nginx serve up static media and proxy all other requests to another backend. My configuration looks like this: location /media {alias /var/httpd/media;} location / {proxy_pass http://127.0.0.1:8080;} However, if a request is made for a non-existing media resource, e.g. /media/foo.js, nginx tries looking for /var/httpd/media/foo.js and then when not found it also tries to proxy the request to 127.0.0.1:8080. Here are the nginx error logs: 2012/05/18 17:09:21 [error] 10073#0: *1 open() "/var/httpd/media/foo.js" failed (2: No such file o (HowTos)