Welcome! Log In Create A New Profile

Advanced

Re: Requests ending with / (slash) are returning 404

April 07, 2010 05:02AM
On Wed, Apr 07, 2010 at 03:50:47PM +0700, Edho P Arief wrote:

> 2010/4/7 Igor Sysoev <igor@sysoev.ru>:
> >      location / {
> >          try_files  $uri  $uri.php  $uri/   =404;
> >
> >          fastcgi_pass 127.0.0.1:9000;
> >          fastcgi_intercept_errors on;
> >          fastcgi_index index.php;
> >          include /usr/local/nginx/conf/fastcgi_params;
> >          fastcgi_param SCRIPT_FILENAME
> >               /home/public_html/domain.com.au/public/$fastcgi_script_name;
> >      }
> >
> > or
> >
> >      location / {
> >          try_files  $uri  $uri.php  ${uri}index.php   =404;
> >
> >          fastcgi_pass 127.0.0.1:9000;
> >          fastcgi_intercept_errors on;
> >          include /usr/local/nginx/conf/fastcgi_params;
> >          fastcgi_param SCRIPT_FILENAME
> >               /home/public_html/domain.com.au/public/$fastcgi_script_name;
> >      }
> >
>
> wouldn't static files also passed to fastcgi in this case?
>
> how about
>
> location / {
> try_files $uri @php;
> }
> location @php {
> try_files $uri.php $uri/ =404;
> ...fastcgi stuff...
> }
>
> ?

Yes, you are right. Also you need to add

   location ~ \.php$ {
...fastcgi stuff...

to prevent handling PHP files as static.


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

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

Requests ending with / (slash) are returning 404

leocrespo April 07, 2010 04:28AM

Re: Requests ending with / (slash) are returning 404

Igor Sysoev April 07, 2010 04:44AM

Re: Requests ending with / (slash) are returning 404

edogawaconan April 07, 2010 04:54AM

Re: Requests ending with / (slash) are returning 404

Igor Sysoev April 07, 2010 05:02AM

Re: Requests ending with / (slash) are returning 404

leocrespo April 07, 2010 05:02AM

Re: Requests ending with / (slash) are returning 404

Igor Sysoev April 07, 2010 05:06AM

Re: Requests ending with / (slash) are returning 404

edogawaconan April 07, 2010 05:08AM

Re: Requests ending with / (slash) are returning 404

leocrespo April 07, 2010 05:14AM

Re: Requests ending with / (slash) are returning 404

edogawaconan April 07, 2010 05:20AM

Re: Requests ending with / (slash) are returning 404

leocrespo April 07, 2010 05:30AM

Re: Requests ending with / (slash) are returning 404

leocrespo April 07, 2010 05:34AM

Re: Requests ending with / (slash) are returning 404

Igor Sysoev April 07, 2010 05:50AM

Re: Requests ending with / (slash) are returning 404

Igor Sysoev April 07, 2010 05:48AM

Re: Requests ending with / (slash) are returning 404

leocrespo April 07, 2010 06:28AM

Re: Requests ending with / (slash) are returning 404

leocrespo April 07, 2010 06:44AM

Re: Requests ending with / (slash) are returning 404

edogawaconan April 07, 2010 06:50AM

Re: Requests ending with / (slash) are returning 404

leocrespo April 07, 2010 07:10AM

Re: Requests ending with / (slash) are returning 404

Igor Sysoev April 07, 2010 05:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 220
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