possible fastcgi_params bug or undocumented feature

Rob Schultz rschultz7 at gmail.com
Fri Mar 21 04:01:49 MSK 2008


Ok thanks. I will adjust the English wiki if i can.

On Thu, Mar 20, 2008 at 7:55 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Thu, Mar 20, 2008 at 06:35:33PM -0500, Rob Schultz wrote:
>
> > Hi,
> >       Today i was configuring nginx to "act" more like apache when using
> https
> > (Apache sets the fastcgi paramater HTTPS to on and this is how
> phpmyadmin
> > detects if you are using https or not) Well i only wanted this paramater
> to
> > be on my https portion of the server so i added it right below my
> > fastcgi_pass directive.
> > http {
> >         include         /etc/nginx/mime.types;
> >         include         /etc/nginx/fastcgi_params;
> >
> > rest of regular config....
> >
> >         ##ssl portion
> >         server {
> >                 listen          443;
> >                 server_name     domain.com www.domain.com;
> >
> >                 ssl on;
> >                 ssl_certificate         /etc/ssl/nginx/server.crt;
> >                 ssl_certificate_key     /etc/ssl/nginx/server.key;
> >
> >                 access_log      /var/log/nginx/domain.com.ssl_access_log
> > main;
> >                 error_log       /var/log/nginx/domain.com.ssl_error_log
> > info;
> >
> >                 root /var/www/domain.com/htdocs;
> >
> >                 location ~ \.php$ {
> >                         fastcgi_pass   127.0.0.1:8026;
> >                         fastcgi_param  HTTPS    on;
> >                         fastcgi_index   index.php;
> >                 }
> >
> >                 location ~* ^.+\.(jpg|jpeg|gif|png)$ {
> >                         access_log   off;
> >                         expires      30d;
> >                 }
> >         }
> > }
> >
> > reloaded the configuration file and hit refresh on a php page displaying
> > phpinfo()  and i get the "No Input file". So after playing around i
> ended
> > up having to add the include directive in my location ~\.php$ section
> like
> > so
> >                 location ~ \.php$ {
> >                         fastcgi_pass   127.0.0.1:8132;
> >                       include /etc/nginx/fastcgi_params;
> >                         fastcgi_param  HTTPS    on;
> >                         fastcgi_index   index.php;
> >                 }
> >
> >
> >
> > So it is looking like adding a fastcgi_param directive is clearing out
> the
> > http section for them.
> > Also the English wiki states "Directives not set are inherited from the
> > outer level. " so that is why i am thinking this is a bug.
>
> No, it's by design and clearly documented at least in russian
> docs.  Probably English wiki needs clarification here.
>
> Basically, when you set array directive at certan level this
> clears everything inherited from upper levels for this array.
> This applies to other array directives as well (proxy_add_header,
> access_log, etc.).
>
> Maxim Dounin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080320/0a5f2ce4/attachment.html>


More information about the nginx mailing list