我们有多站点设置,需要将域和域/子文件夹映射到变量.这样编程就知道要加载哪个版本.
我们的商店有独立的域名,可以通过$http_host
domain.com/-string-locale-here-捕获,$http_host$uri
并通过匹配命令捕获
不知怎的,以下不起作用.这可能是因为有两个map命令,都映射到同一个变量$storecode
或者可能出现什么问题?
map $http_host $storecode {
default dom_nl;
domain.com dom_nl;
domain.de dom_de;
store.com str_de;
}
map $http_host$uri $storecode {
~^store.com/en.* str_en;
~^store.com/fr.* str_fr;
}
Run Code Online (Sandbox Code Playgroud) nginx ×1