Welcome! Log In Create A New Profile

Advanced

Re: Directory fallback

Tobia Conforto
December 30, 2009 06:46AM
Eureka!

Final version, accomplishing all my objectives:
- site dir, with fallback to base dir;
- static files directly, php files through fastcgi;
- not calling fastcgi on nonexistent files;
- not using "if" (somebody mentioned performance problems?)

location / {
root /var/www/site1;
try_files $uri @base;
}
location @base {
root /var/www/base;
}
location ~ \.php$ {
root /var/www/site1;
try_files $uri @basephp;
fastcgi_pass 127.0.0.1:9000;
}
location @basephp {
root /var/www/base;
try_files $uri ERROR;
fastcgi_pass 127.0.0.1:9000;
}

Is there anything nicer I can put in the last try_files, instead of the nonexistent file "ERROR"?

Tobia
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Directory fallback

Tobia Conforto December 29, 2009 01:00PM

Re: Directory fallback

merlin corey December 29, 2009 04:24PM

Re: Directory fallback

Tobia Conforto December 29, 2009 06:32PM

Re: Directory fallback

merlin corey December 30, 2009 02:32AM

Re: Directory fallback

Tobia Conforto December 30, 2009 06:46AM

Re: Directory fallback

merlin corey January 07, 2010 01:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready