【发布时间】:2018-03-07 23:20:02
【问题描述】:
我们正在使用反向代理来允许防火墙外部的用户访问内部服务器上的服务。然而,虽然我们使用了ProxyPreserveHost 指令,但使用 URL http://project.domain.com/index.html 的请求会导致http://internal.server/index.html 而不是预期的http://project.domain.com/index.html。
这是我们的虚拟主机定义:
<VirtualHost *:443>
ServerName "https://project.domain.com"
SSLEngine on
SSLCertificateFile /etc/ssl/our.cer
SSLCertificateKeyFile /etc/ssl/private/our.key
ProxyRequests Off
ProxyVia Off
<Proxy *>
Require all granted
</Proxy>
ProxyPreserveHost On
ProxyPass / http://internal.server:80/
ProxyPassReverse / http://internal.server:80/
</VirtualHost>
【问题讨论】:
标签: reverse-proxy host apache2.4