在一个nginx server上有多个域名,想让访问其中一个具体的页面如下,就rewrite到google.com
配置如下,发现并没有生效,感觉 $http_host$request_uri 没有匹配到那个页面。
server {
listen 80;
server_name www.domain1.com www.domain2.com www.domain3.com ;
if ($http_host$request_uri ~ www.domain2.com/hello.html) {
rewrite ^ google.com permanent;
}
}
谁知道怎么写呢?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
业精于勤,荒于嬉;行成于思,毁于随。