我目前在Magento中使用nginx,我使用map指令来提供这样的商店代码:
map $http_host $magecode { www.store.com retail_store; wholesale.store.com wholesale_store; beta.store.com retail_beta_view; }
这样做的缺点是,如果我testing网站是自己的商店,我不能使用相同的目录。 相反,我想使testing版网站,而不是商店 。
是否可以同时映射两个variables? 我想象它会是这样的:
map $http_host $magecode $magetype { www.store.com retail_store website; wholesale.store.com wholesale_store website; beta.store.com retail_beta_view store; }
如果不是,我可以映射相同的variables两次?
map $http_host $magecode { ... } map $http_host $magetype { ... }
是的,你可以使用多个map ,这似乎是解决这个问题最简单的方法。
map $http_host $magecode { www.store.com retail_store; wholesale.store.com wholesale_store; beta.store.com retail_beta_view; } map $http_host $magetype { www.store.com website; wholesale.store.com website; beta.store.com store; }