Welcome! Log In Create A New Profile

Advanced

Re: Global PHP Rule

May 03, 2009 08:41PM
Mathew Davies wrote:
> Hi,
>
> Is there a way to specify a global PHP location rule? As you can see
> below, the PHP block is repeated which is no good.

Best as I can tell from
http://wiki.nginx.org/NginxHttpFcgiModule#fastcgi_pass, that's they way
it is.

fastcgi_pass

syntax: fastcgi_pass fastcgi-server

default: none

context: location, if in location

Directive assigns the port or socket on which the FastCGI-server is
listening. Port can be indicated by itself or as an address and
port, for example:

fastcgi_pass localhost:9000;

using a Unix domain socket:

fastcgi_pass unix:/tmp/fastcgi.socket;

>
> # domain1.tld
> server
> {
> server_name domain1.tld;
> root html/domain1;
>
> location ~ \.php$
> {
> fastcgi_pass 127.0.0.1:9000 http://127.0.0.1:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> include fastcgi_params;
> }
> }
>
> # domain2.tld
> server
> {
> server_name domain2.tld;
> root html/domain2;
>
> location ~ \.php$
> {
> fastcgi_pass 127.0.0.1:9000 http://127.0.0.1:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> include fastcgi_params;
> }
> }
>
> Thank You.

Jim
Subject Author Posted

Global PHP Rule

Mathew Davies May 03, 2009 08:06PM

Re: Global PHP Rule

mike May 03, 2009 08:40PM

Re: Global PHP Rule

Jim Ohlstein May 03, 2009 08:56PM

Re: Global PHP Rule

Mathew Davies May 03, 2009 09:05PM

Re: Global PHP Rule

edogawaconan May 03, 2009 09:25PM

Re: Global PHP Rule

mike May 03, 2009 09:33PM

Re: Global PHP Rule

Jim Ohlstein May 03, 2009 08:41PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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