What's fastcgi_param scope

Jakub Zalas jzalas at gmail.com
Thu Mar 24 13:22:56 MSK 2011



On Mar 24, 10:24 am, Maxim Dounin <mdou... at mdounin.ru> wrote:
> Hello!
>
> On Wed, Mar 23, 2011 at 04:34:38PM -0700, Jakub Zalas wrote:
> > Hi,
>
> Just a side note: use "location = /foo/bar" instead.

Actually I need a regexp here. I just simplified my example.

> As soon as you did internal redirect (with rewrite) -
> configuration in this location no longer applies.  Instead
> configuration in destination location will be used.

This explains a lot. Thanks!


> See above.  Solution is to write explicitly what you want to
> happen instead of using internal redirects, i.e. something like
> this:
>
>     location = /foo/bar {
>         fastcgi_pass 127.0.0.1:9000;
>         include /etc/nginx/fastcgi_params;
>         fastcgi_param SCRIPT_FILENAME /var/www/$host/web/app.php;
>         fastcgi_param _ROUTING__route foo;
>         ...
>     }
>
> Maxim Dounin
>
> p.s. The only thing which survives internal redirect is variables.  
> Theoretically you may rewrite your config to set some variables
> before rewrite and then use appropriate fastcgi_param in .php
> location.  But it's not going to scale well and not recommended.

Thank you. Your suggestions helped me a lot.




More information about the nginx mailing list