7 messages in ru.sysoev.nginxRe: Global PHP Rule
FromSent OnAttachments
Mathew DaviesMay 3, 2009 5:05 pm 
Michael ShadleMay 3, 2009 5:40 pm 
Jim OhlsteinMay 3, 2009 5:40 pm 
Jim OhlsteinMay 3, 2009 5:56 pm 
Mathew DaviesMay 3, 2009 6:04 pm 
Edho P AriefMay 3, 2009 6:25 pm 
Michael ShadleMay 3, 2009 6:32 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Global PHP RuleActions...
From:Jim Ohlstein (jim.@gmail.com)
Date:May 3, 2009 5:56:17 pm
List:ru.sysoev.nginx

Michael Shadle wrote:

On Sun, May 3, 2009 at 5:06 PM, Mathew Davies <thep@googlemail.com> wrote:

location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }

You can put these in fastcgi_params:

fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

Also you can put all the fastcgi_params globally on the http {} block.

I have done that, and it works well, there is some random situation though where if I try to override a fastcgi_param somewhere else, all of them get unset.

Correct me if I'm wrong, but you still have to put

location ~ \.php$ { fastcgi_pass 127.0.0.1:9000;

... }

for each server block where you want to configure php. Even if you are able to
put the fastcgi_pass directive into fastcgi_params, something I haven't tried,
you'd still need

location ~ \.php$ {

include fastcgi_params; }

in any server block where you wanted to run run php scripts since fastcgi_pass
has to be in a location block.

Jim