Welcome! Log In Create A New Profile

Advanced

Re: -f $request_filename

April 19, 2010 01:20PM
On Mon, Apr 19, 2010 at 05:25:12PM +0200, Tomasz Pajor wrote:

>
> > Hello
> >> Got something like this, but the break seams to not work,
> >> and the file is being processed by the php fastcgi process.
> >>
> >> Any clue why?
> >>
> >> location / {
> >> if (-f $request_filename) {
> >> root /vhosts/default/test;
> >> break;
> >> }
> >>
> >> try_files $uri $uri/ @fallback;
> >> fastcgi_pass unix:/var/run/spawn-fcgi.sock;
> >>
> > Wow. I wonder what you are trying to achieve...
> >
> When requesting http://domain.tld/sitemap.xml the request should
> got to the fastcgi process, because that needs to be generated from
> application.
>
> But when requesting other xml files it should use the files;

A generic method:

location / {
root /vhosts/default/test;
try_files $uri $uri/ @fallback;
}

location @fallback {
fastcgi_pass unix:/var/run/spawn-fcgi.sock;
...
}

Or always pass XML to fastcgi:

location / {
root /vhosts/default/test;
}

location ~ \.xml$ {
fastcgi_pass unix:/var/run/spawn-fcgi.sock;
...
}


--
Igor Sysoev
http://sysoev.ru/en/

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

-f $request_filename

Tomasz Pajor April 19, 2010 08:58AM

Re: -f $request_filename

edogawaconan April 19, 2010 09:12AM

Re: -f $request_filename

Tomasz Pajor April 19, 2010 11:32AM

Re: -f $request_filename

Maxim Dounin April 19, 2010 10:10AM

Re: -f $request_filename

Tomasz Pajor April 19, 2010 11:30AM

Re: -f $request_filename

Igor Sysoev April 19, 2010 01:20PM

Re: -f $request_filename

Tomasz Pajor April 19, 2010 02:04PM

Re: -f $request_filename

edogawaconan April 19, 2010 10:34PM

Re: -f $request_filename

Igor Sysoev April 20, 2010 01:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready