Welcome! Log In Create A New Profile

Advanced

Re: nginx + php-fpm "modern configuration way"

April 03, 2012 05:12PM
Well, in that case you may as well support SCRIPT_URL / SCRIPT_URI, as there are some [old] PHP scripts that rely on these variables set normally by Apache.

nginx.conf:

http {
...
map $uri $script_url {
~^(?<script_filename>.+\.(php|html))(?<path_info>.+)$ $path_info;
~^(?<script_filename>.+\.(php|html))$ $script_filename;
}
...
}

fastcgi_php.conf:

include fastcgi_params;

fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

fastcgi_param SCRIPT_URL $script_url;
fastcgi_param SCRIPT_URI $scheme://$http_host$script_url;

try_files $fastcgi_script_name = 404;
Subject Author Posted

nginx + php-fpm "modern configuration way"

gpakosz April 03, 2012 04:52AM

Re: nginx + php-fpm "modern configuration way"

Edho Arief April 03, 2012 04:54AM

Re: nginx + php-fpm "modern configuration way"

gpakosz April 03, 2012 05:04AM

Re: nginx + php-fpm "modern configuration way"

Tiberius April 03, 2012 06:22AM

Re: nginx + php-fpm "modern configuration way"

gpakosz April 03, 2012 02:58PM

Re: nginx + php-fpm "modern configuration way"

locojohn April 03, 2012 05:05AM

Re: nginx + php-fpm "modern configuration way"

Antonio P.P. Almeida April 03, 2012 05:08AM

Re: nginx + php-fpm "modern configuration way"

locojohn April 03, 2012 05:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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