Welcome! Log In Create A New Profile

Advanced

handling subdirectories location

Thiago Farina
June 07, 2015 09:36AM
Hi,

I have the following in my nginx configuration:

server {
listen 8080;
server_name myservername.com;
root /data/www/myservername.com;

location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.html;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000.
location ~ \.php$ {
try_files $uri = 404;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

But how do I configure 'location' so /subdir/index.php is processed
instead of /index.php?

Basically I'm trying to put third_party apps in their /subdirs/ to
test them, but when they navigate to index.php I'm thrown back to the
root /index.html for example.

Thanks in advance,

--
Thiago Farina

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

handling subdirectories location

Thiago Farina June 07, 2015 09:36AM

Re: handling subdirectories location

Thiago Farina June 07, 2015 01:52PM

Re: handling subdirectories location

Thiago Farina June 08, 2015 01:08PM

Re: handling subdirectories location

Francis Daly June 08, 2015 06:48PM

Re: handling subdirectories location

Thiago Farina June 08, 2015 07:10PM

Re: handling subdirectories location

Francis Daly June 08, 2015 07:28PM

Re: handling subdirectories location

Thiago Farina June 08, 2015 07:54PM

Re: handling subdirectories location

Francis Daly June 08, 2015 09:00PM

Re: handling subdirectories location

Thiago Farina June 10, 2015 04:02PM

Re: handling subdirectories location

Francis Daly June 10, 2015 05:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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