浏览 4.1k
测试命令:
telnet xx.xx.xx.xx 8747
GET / HTTP/1.0
响应:
HTTP/1.1 302 Moved Temporarily
Date: Mon, 21 Dec 2020 07:06:19 GMT
Content-Type: text/html
Content-Length: 126
Connection: close
Location: https://192.168.234.111:8747/
Server: Server
<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
</body>
</html>
其中响应中Location返回了内部IP,违反安全规则,如何隐藏或是屏蔽呢??

按点赞数排序
按时间排序
你是想把上游返回 的Location值修改掉吗?可以使用proxy_redirect指令,用法在这http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect。
另外,通常上游是应当知道对外的域名的,否则很多跨域的安全问题就无法解决,此时上游的Location是能够拼出正确的域名的。
1
回答于2020-12-21 16:40
不支持,nginx发送普通文件时可以使用此指令提高性能。proxy_pass指向的是upstream,如果压缩需要配置upstream。
https://trac.nginx.org/nginx/ticket/965#comment:6
微信公众号
加入微信群