Welcome! Log In Create A New Profile

Advanced

Re: location = / strange behavior

August 04, 2009 11:31AM
On Tue, Aug 04, 2009 at 10:28:22AM -0400, fritz wrote:

> Hi.
>
> If URI is "/" I need to show index.html.
> Else I need to execute a php script.
>
> According to http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#location
> my config looks like this:
>
> server {
> listen 80;
> server_name localhost;
> location = / {
> root /home/www;
> index index.html;
> }
> location / {
> fastcgi_pass 127.0.0.1:8888;
>
> fastcgi_param SCRIPT_FILENAME /home/www/click.php;
> ...
> }
> }
>
> But always triggers only the second rule.
> Tried with 0.6.32 and 0.7.59.

You need also to add

location = /index.html {
root /home/www;
}

since nginx does internal redirect "/" -> "/index.html".


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

location = / strange behavior

fritz August 04, 2009 10:28AM

Re: location = / strange behavior

Igor Sysoev August 04, 2009 11:31AM

Re: location = / strange behavior

fritz August 04, 2009 01:21PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready