访问时:http : //example.com/somefolder --> http://example.com:8080/somefolder
我试过这个:
http {
port_in_redirect off;
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
小智 29
我刚刚遇到了同样的问题并且port_in_redirect off;
实际上对我有用,只要确保你在server {}
块内使用它。
server {
listen 8080;
server_name example.com;
port_in_redirect off;
autoindex on;
location / {
root /var/www/example.com;
index index.html;
}
}
Run Code Online (Sandbox Code Playgroud)
http://wiki.codemongers.com/NginxHttpCoreModule#port_in_redirect
syntax: port_in_redirect [ on|off ]
default: port_in_redirect on
context: http, server, location
Run Code Online (Sandbox Code Playgroud)
希望这就是您正在寻找的。
归档时间: |
|
查看次数: |
57156 次 |
最近记录: |