在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 (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...