我让nginx在一个港口容器中监听端口80,该容器将端口映射为8080。
当我去http://example.com:8080/test时,nginx将我重定向到http://example.com/test/,而我希望它是http://example.com:8080/test/。
Nginx配置:
server {
listen 80;
location /test {
try_files $uri $uri/ /test.html;
}
}如何使nginx使用请求源进行重定向?
发布于 2022-03-10 01:35:52
使用absolute_redirect off;解决了这个问题。
https://serverfault.com/questions/1095711
复制相似问题