Welcome! Log In Create A New Profile

Advanced

Re: How to setup nginx to make php works in site subdirectories

February 12, 2012 12:48PM
Hello, Joe,

behind what /?

I've tried different variants. But I really misunderstand how it should be.

The goal is to make nginx process .php files whereever they located begining from site's root folder.

This settings works fine with scripts in site's root.

location ~ \.php$ {
root /var/www/nginx-default/example.com;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default/example.com$fastcgi_script_name;
include fastcgi_params;
}

This redirects 'example.com/popups/popup_on_enter.php' to php-fpm but it returns 'File not found'.

location /popups/popup_on_enter.php {
root /var/www/nginx-default/example.com/popups;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default/example.com/popups$fastcgi_script_name;
include fastcgi_params;
}

I suppose there sould be variant with one 'location' directive processing all the files in /var/www/nginx-default/example.com.
But due to my little experience I can't realize how to reach the goal.

Thank you.
Subject Author Posted

How to setup nginx to make php works in site subdirectories

dimentiy February 12, 2012 06:00AM

Re: How to setup nginx to make php works in site subdirectories

Joe February 12, 2012 06:12AM

Re: How to setup nginx to make php works in site subdirectories

dimentiy February 12, 2012 06:33AM

Re: How to setup nginx to make php works in site subdirectories

Joe February 12, 2012 07:22AM

Re: How to setup nginx to make php works in site subdirectories

dimentiy February 12, 2012 12:48PM

Re: How to setup nginx to make php works in site subdirectories

Francis Daly February 12, 2012 08:00AM

Re: How to setup nginx to make php works in site subdirectories

dimentiy February 12, 2012 01:04PM

Re: How to setup nginx to make php works in site subdirectories

dimentiy February 12, 2012 01:14PM

Re: How to setup nginx to make php works in site subdirectories

dimentiy February 12, 2012 03:28PM

Re: How to setup nginx to make php works in site subdirectories

Francis Daly February 12, 2012 03:12PM

Re: How to setup nginx to make php works in site subdirectories

Francis Daly February 12, 2012 04:54PM

Re: How to setup nginx to make php works in site subdirectories

Max February 12, 2012 07:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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