【发布时间】:2019-09-08 01:33:54
【问题描述】:
谁能明白为什么下面的 Nginx if 语句不起作用
if ($host != subdomain.mydomain.com) {
set $test A;
}
if ($request_uri != /.well-known/acme-challenge/(.*?)) {
set $test "${test}B";
}
if ($test = AB) {
rewrite ^/(.*) https://www.anotherdomain/$1 permanent;
break
}
在英文中,如果主机不是 subdomain.mydomain.com 并且请求 URI 不是 /.well-known/acme-challenge/* 那么我希望它重定向到另一个域
【问题讨论】:
标签: nginx nginx-config