在 Apache 反向代理后面的 Apache 上使用 Joomla
Using Joomla on Apache behind Apache Reverse Proxy
我在 Ubuntu 16.04 服务器上的 Apache2(端口 83)运行 上安装了 Joomla。
当我从 192.168.178.14:83 等本地网络连接到页面时,它出现并且一切正常。要从 Internet 访问我的页面,还有另一个服务器 运行 Apache2,它充当代理服务器。所有通过端口 80 和 443 的流量都到达这台机器,它使用 ServerName 来决定流量必须转发到哪台机器。这适用于大约 10 个域和机器。
但是当我连接到我的 Joomla 域时,我得到一个没有任何格式、图形和模板的 HTML 站点。当我将一个端口直接转发到这台机器时,一切正常,使用这个端口进行连接。
network topologie
我在 Ubuntu1 上的 VirtualHost 配置:
<VirtualHost *:80>
ServerName ksg-events.de
Redirect permanent / https://ksg-events.de/
</VirtualHost>
<VirtualHost *:443>
ServerName ksg-events.de
ProxyPreserveHost On
ProxyRequests Off
ProxyVia Off
ProxyPass / http://192.168.178.14:83/
ProxyPassReverse / http://192.168.178.14:83/
SSLCertificateFile /etc/letsencrypt/live/ksg-events.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ksg-events.de/privkey.pem
</VirtualHost>
Ubuntu2 上的虚拟主机配置:
<VirtualHost *:83>
DocumentRoot /var/www/ksg-events.de/joomla
</VirtualHost>
感谢您的帮助!
我找到了解决问题的办法:
运行 Apache 反向代理 (http) 背后的 Joomla:
- 将
ProxyVia full
添加到代理的 VirtualHost 配置
使用 https:
- 在代理服务器上启用
mod_headers
- 将
RequestHeader set X-Forwarded-Proto "https"
添加到代理的 VirtualHost
我希望能帮助 运行 遇到同样问题的人。
我在 Ubuntu 16.04 服务器上的 Apache2(端口 83)运行 上安装了 Joomla。 当我从 192.168.178.14:83 等本地网络连接到页面时,它出现并且一切正常。要从 Internet 访问我的页面,还有另一个服务器 运行 Apache2,它充当代理服务器。所有通过端口 80 和 443 的流量都到达这台机器,它使用 ServerName 来决定流量必须转发到哪台机器。这适用于大约 10 个域和机器。 但是当我连接到我的 Joomla 域时,我得到一个没有任何格式、图形和模板的 HTML 站点。当我将一个端口直接转发到这台机器时,一切正常,使用这个端口进行连接。 network topologie
我在 Ubuntu1 上的 VirtualHost 配置:
<VirtualHost *:80>
ServerName ksg-events.de
Redirect permanent / https://ksg-events.de/
</VirtualHost>
<VirtualHost *:443>
ServerName ksg-events.de
ProxyPreserveHost On
ProxyRequests Off
ProxyVia Off
ProxyPass / http://192.168.178.14:83/
ProxyPassReverse / http://192.168.178.14:83/
SSLCertificateFile /etc/letsencrypt/live/ksg-events.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ksg-events.de/privkey.pem
</VirtualHost>
Ubuntu2 上的虚拟主机配置:
<VirtualHost *:83>
DocumentRoot /var/www/ksg-events.de/joomla
</VirtualHost>
感谢您的帮助!
我找到了解决问题的办法:
运行 Apache 反向代理 (http) 背后的 Joomla:
- 将
ProxyVia full
添加到代理的 VirtualHost 配置
使用 https:
- 在代理服务器上启用
mod_headers
- 将
RequestHeader set X-Forwarded-Proto "https"
添加到代理的 VirtualHost
我希望能帮助 运行 遇到同样问题的人。