如何解决在apache反向代理中处理位置标头
我正在使用Apache / 2.4.29(Ubuntu),需要将其配置为内部Web服务器的反向代理服务器。我的虚拟主机配置如下所示。
ServerName web.example.com
ServerAlias web.example.com
ProxyRequests off
ProxyPreserveHost On
ProxyPass / http://192.168.1.15/web/public/
ProxyPassReverse / http://192.168.1.15/web/public/
ProxyPassReverseCookiePath / /
<Location "/">
Order allow,deny
Allow from all
</Location>
ErrorLog ${APACHE_LOG_DIR}/web-error.log
CustomLog ${APACHE_LOG_DIR}/web-access.log combined
预期结果:http://web.example.com 和 实际结果:http://web.example.com/web/public/
当我卷曲URL时。 $ curl -v http://web.example.com
- 尝试10.0.0.1 ...
- 设置了TCP_NODELAY
- 已连接到web.example.com(10.0.0.1)端口80(#0)
- GET / HTTP / 1.1
- 主机:web.example.com
- 用户代理:curl / 7.58.0
- 接受: /
- 找到HTTP / 1.1 302
- 日期:格林尼治标准时间2020年8月30日星期日13:28:09
- 服务器:Apache / 2.4.29(Ubuntu)
- 缓存控制:无缓存,私有
- 位置:http://web.example.com/web/public/
- 内容长度:522
- 内容类型:text / html; charset = UTF-8
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。