Nginx variables similar to SetEnv in Apache?

前端 未结 4 1966
遥遥无期
遥遥无期 2020-11-27 13:59

I use SetEnv in Apache to set some variables in virtualhosts that I recover in PHP using $_SERVER[the_variable].

Now I am switching to Perl Catalyst and

4条回答
  •  旧巷少年郎
    2020-11-27 14:24

    NGINX doesn't manage your backend processes like apache does, so it can't affect their environments. To set a new $_SERVER PHP variable from NGINX, you need to add a new fastcgi_param entry along with the rest of them. Wherever you're including fastcgi_params or fastcgi.conf.

提交回复
热议问题