Welcome! Log In Create A New Profile

Advanced

How to setup nginx to make php works in site subdirectories

February 12, 2012 06:00AM
Hello,

I'm nuewbie in nginx, I've installed and setup nginx & php,
everything is fine except .php files located in site's subdirectories
are not processed at all.

i.e. example.com/download.php works fine, but
example.com/stuff/dosomething.php is sent to client as plain text.

Please, would any kind soul tell me what should I change to resolve the
problem.
Thank you.

I use those settings.

#
# example.com
#

server {
listen 80;
server_name example.com;

access_log /var/log/nginx/example.com.access.log;

location / {
root /var/www/nginx-default/example.com;
index index.html index.htm index.php;
}

## Parse all .php file in the /var/www directory
location ~ .php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/var/www/nginx-default/example.com$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}

## Disable viewing .htaccess & .htpassword
location ~ /\.ht {
deny all;
}
}

upstream backend {
server 127.0.0.1:9000;
}

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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: 297
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