I have a NginX vhost, where all static content is served by nginx and anything that's not found or ends with php proxies to apache.
Just wanted to check if I have locations right:
location / {
try_files $uri $uri/ @proxy;
expires 30d;
}
location ~* \.php$ {
proxy_pass http://127.0.0.1:8080;
}
location @proxy {
proxy_pass http://127.0.0.1:8080;
}
I was also wondering if there is a way to make second location go to third so that I do not have to repeat the proxy_pass line twice?
I have few other questions:
Does nginx read locations from top to bottom and does it stop looking at next location if curent request matches one of the locations? For example, if server.com/image.jpg is requested, does it mean the very first location declaration will capture it in my locations, and rest will be ignored?
If I do expires max; or expires 30d; but then site is updated and I want to force user browsers to reload the file right away, is there anything I can do to make them reload?
my very first location declaration will match anypath that ends with .js, .css, .png and so on, but is it case sensitive? will it also match .PNG ? Should I make it case sensitive or not? If yes, how?
Is there anything else you think would improve this configuration?
Should do it