我使用的是 nginx/1.18.0 (Ubuntu)
我想实现以下目标
来自:
https://www.testsite.com/mypath
到
http://myip:9990/index.html
这就是我现在所拥有的,但由于某种原因它不起作用
location /mypath{
return 301 http://myip:9990/index.html;
}
我对 ngnix 很陌生,感谢您的帮助。
答案 0 :(得分:0)
rewrite ^/mypath$ http://myip:9990/index.html last;
响应为 HTTP 301