Welcome! Log In Create A New Profile

Advanced

Re: fastcgi server variables vs. apache

This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Igor Sysoev
December 16, 2009 09:00AM
On Wed, Dec 16, 2009 at 08:40:17AM -0500, spirit wrote:

> @shizobuddy: /path/to/php is usually $document_root if set properly so you come up with the following generic config:
>
> fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;

The slash is not needed:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

> @androo: instead of setting fastcgi_param in a if (in fact you can't), you can still set variables to do so. Example
>
>
> set $script index.php;
> set $path_info "";
> if ($uri ~ "^(.+\.php)(.*)") {
> set $script $1;
> set $path_info $2;
> }
> fastcgi_param PATH_INFO $path_info;
> ....

It's better to use fastcgi_split_path_info:

location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME /path/to/php$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;

or named captures:

location ~ ^(?<script_name>.+\.php)(?<path_info>.*)$ {

fastcgi_param SCRIPT_FILENAME /path/to/php$script_name;
fastcgi_param PATH_INFO $path_info;


--
Igor Sysoev
http://sysoev.ru/en/

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

fastcgi server variables vs. apache

androo April 06, 2009 07:55PM

Re: fastcgi server variables vs. apache

Denis F. Latypoff April 06, 2009 10:49PM

Re: fastcgi server variables vs. apache

androo April 07, 2009 11:02PM

Re: fastcgi server variables vs. apache

My SchizoBuddy December 10, 2009 09:36AM

Re: fastcgi server variables vs. apache

Igor Sysoev December 10, 2009 09:44AM

Re: fastcgi server variables vs. apache

spirit December 16, 2009 08:40AM

Re: fastcgi server variables vs. apache

Igor Sysoev December 16, 2009 09:00AM

Re: fastcgi server variables vs. apache

locojohn July 07, 2011 09:22AM



Online Users

Guests: 232
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready