Welcome! Log In Create A New Profile

Advanced

Re: Problem with inheriting fastcgi params

June 05, 2009 03:53PM
On Fri, 2009-06-05 at 12:36 -0700, Michael Shadle wrote:
> I have my normal fastcgi params in my main nginx.conf file, under server {}
>
> i.e.:
>
> 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_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> fastcgi_param SCRIPT_NAME $fastcgi_script_name;
> fastcgi_param REQUEST_URI $request_uri;
> fastcgi_param DOCUMENT_URI $document_uri;
> fastcgi_param DOCUMENT_ROOT $document_root;
> fastcgi_param SERVER_PROTOCOL $server_protocol;
> fastcgi_param GATEWAY_INTERFACE CGI/1.1;
> fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
> fastcgi_param REMOTE_ADDR $remote_addr;
> fastcgi_param REMOTE_PORT $remote_port;
> fastcgi_param SERVER_ADDR $server_addr;
> fastcgi_param SERVER_PORT $server_port;
> fastcgi_param SERVER_NAME $http_host;
> fastcgi_ignore_client_abort on;
> fastcgi_buffers 32 8k;
> fastcgi_index index.php;
>
>
> The problem is, whenever I want to add a variable (maybe override too,
> I forget) it seems to clear all the other ones out:
>
> location ~ \.php$ {
> fastcgi_pass 127.0.0.1:11003;
> fastcgi_param HTTPS on;
> }
>
> Now, only fastcgi_param HTTPS is set. no more SCRIPT_FILENAME so it's broken.
>
> I would assume it would be able to inherit everything globally and
> only add to the fastcgi_params on demand.
>
> This is using nginx 0.7.55 or thereabouts but it's been an issue I've
> noticed in the past too.
>
> Can nginx support this?

Put your params in a separate file and include them wherever they are
needed:

location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:11003;
fastcgi_param HTTPS on;
}

This doesn't incur any additional overhead.

Cliff


--
http://www.google.com/search?q=vonage+sucks
Subject Author Posted

Problem with inheriting fastcgi params

mike June 05, 2009 03:36PM

Re: Problem with inheriting fastcgi params

mike June 05, 2009 03:59PM

Re: Problem with inheriting fastcgi params

Cliff Wells June 05, 2009 03:53PM

Re: Problem with inheriting fastcgi params

Maxim Dounin June 05, 2009 04:17PM

Re: Problem with inheriting fastcgi params

mike June 05, 2009 04:49PM

Re: Problem with inheriting fastcgi params

Cliff Wells June 05, 2009 05:10PM

Re: Problem with inheriting fastcgi params

Cliff Wells June 05, 2009 05:12PM

Re: Problem with inheriting fastcgi params

mike June 05, 2009 05:56PM

Re: Problem with inheriting fastcgi params

Maxim Dounin June 05, 2009 10:03PM

Re: Problem with inheriting fastcgi params

mike June 05, 2009 10:33PM

Re: Problem with inheriting fastcgi params

Cliff Wells June 06, 2009 12:33AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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