【发布时间】:2019-01-19 19:32:40
【问题描述】:
我想要的是输入 test.com/path 并将其转到 anothersite.com,但它却转到了 differentsite.com。我相信我的格式正确,但似乎完全跳过了位置块。
server {
listen 80;
listen [::]:80;
server_name test.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443;
listen [::]:443;
server_name test.com;
location /path {
return 301 https://anothersite.com;
}
return 301 https://differentsite.com;
}
【问题讨论】:
标签: nginx networking uri url-redirection nginx-location