我使用mod_proxy(Apache2)配置反向代理,侦听127.0.0.1:80,代理所有请求到127.0.0.1:8080
所以我配置了mod_proxy,如:
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /foo http://127.0.0.1:8080
ProxyPassReverse /foo http://127.0.0.1:8080
当我请求http://127.0.0.1/foo/bar
时,侦听127.0.0.1:8080的应用从mod_proxy获取以下请求网址:
相反,我想保留原始请求,并获取:
我该怎么做?
答案 0 :(得分:5)
修正:
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /foo http://127.0.0.1:8080/foo
ProxyPassReverse /foo http://127.0.0.1:8080/foo