...
map $http_origin $corsHost {
default '-miss-me-wit-dis-yo-';
hostnames;
.namethatmaps.net $http_origin;
http://localhost:5555 # working sample
localhost $http_origin; # sample 1
.localhost:555.+ $http_origin; # sample 2
}
始终未通过此测试值$http_origin = http://localhost:5555
通配符localhost没有模式吗?
答案 0 :(得分:0)
这解决了我的用例:
map $http_origin $corsHost {
...
hostnames;
~localhost:555 $http_origin;
}