【发布时间】:2018-09-14 06:44:33
【问题描述】:
我有一个这样的网址: http://test1.com/_a/client/#/room/!zzz:test2.com
我想用这样的 IP 地址和端口替换这个参数 test2.com:
http://test1.com/_a/client/#/room/!zzz:192.x.x.x:80
我怎样才能用 nginx 做到这一点? 这是我所做的:
location /_a/client/#/room/ {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1/_a/client/#/room/!zzz:192.x.x.x:80;
}
但它不起作用。
【问题讨论】:
-
您不能在
nginx中执行此操作。片段(从#开始的URL 的一部分)永远不会发送到nginx服务器。