Location container read order

Rob Schultz rschultz7 at gmail.com
Thu Dec 3 05:24:39 MSK 2009


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

Nginx will use the location that matches the most specific. So any of your locations should match before location / since that will be the least general. 

Rob
On Dec 2, 2009, at 8:12 PM, nerdgrind wrote:

> I have one "location" container that servers static content:
> 
> location ~ \.(html|htm|xml|css|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
> 
> and another "location" container that uses a backend apache server to serve PHP file requests:
> 
> location / {
> proxy_pass http://127.0.0.1:8008;
> 
> Are the "location" containers read in the order that they appear in the configuration file? In the example above would the static location be read before the proxy_pass container, insuring that the static content "html" files would be served before a "php" file from the back proxy server?
> 
> I am trying to insure the proxy server does not serve php files that may already exist as html files generated by WP Super Cache in Wordpress.
> 
> All the best,
> 
> Todd
> 
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,27566,27566#msg-27566
> 
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx





More information about the nginx mailing list