我下面还有我的Apache网站的.htaccess设置;现在我提出这个中Nginx的。因此,我不知道我怎么可以把下面的SetEnvIf之后parmeters在.htaccess文件Nginx的Configuraiton的?我认为它的设立'fastcgi_param,请帮我做了转换。
I have below .htaccess settings along with my Apache website; now I am moving this in to Nginx. Thus I wonder how can I put below 'SetEnvIf' parmeters in .htaccess file to Nginx configuraiton? I think its by setting up 'fastcgi_param', please help me to do the conversion.
SetEnvIf HOST albany.mywebsite.com MAGE_RUN_CODE=w2760
SetEnvIf HOST albany.mywebsite.com MAGE_RUN_TYPE=website
SetEnvIf HOST alexandria.mywebsite.com MAGE_RUN_CODE=w1472
SetEnvIf HOST alexandria.mywebsite.com MAGE_RUN_TYPE=website
SetEnvIf HOST annarbor.mywebsite.com MAGE_RUN_CODE=w2933
SetEnvIf HOST annarbor.mywebsite.com MAGE_RUN_TYPE=website
感谢你。
你能做到这一点是这样的:
you can do it like this:
if ($host = albany.mywebsite.com) {
env MAGE_RUN_CODE=w2769;
env $MAGE_RUN_TYPE=website;
}
(等为其他主机值)
(and so on for the other host values)
看http://nginx.org/en/docs/ngx_core_module.html#env