如何在 ISPConfig 中设置反向代理?

问题描述

是否可以在 ISPConfig 中设置反向代理?

我在子域上尝试了此设置,但只收到错误 500。

enter image description here

/var/www/influxdb2.*******.***/log/error.log 表示如下:

==> error.log <==
[Fri Jan 01 21:24:15.963158 2021] [proxy:warn] [pid 30333] [client ***.***.***.***:59356] AH01144: No protocol handler was valid for the URL /favicon.ico (scheme 'http'). If you are using a DSO version of mod_proxy,make sure the proxy submodules are included in the configuration using LoadModule.,referer: https://influxdb2.*******.***/

解决方法

对我来说,proxy_http mod 不见了。

通过 sudo a2enmod proxy_http 启用它并使用 systemctl restart apache2 重新启动您的 apache(感谢 https://serverfault.com/questions/773449/no-protocol-handler-valid-for-the-url-with-httpd-mod-proxy-balancer)。

另请注意,“重定向类型”设置 enter image description here 有时似乎在保存时将自身重置为“无”(或者至少在 ISPConfig 3.2.1 中加载页面时不会显示正确的值)。因此,如果出现问题,请仔细检查该设置。

对于“域”选项卡,设置非常简单。只需输入您的域并可能启用 Let's Encrypt。

enter image description here

请注意,这似乎使用 mod_rewrite 进行代理。 Apache2 documentation on mod_rewrite 指出应该使用更好的 ProxyPassmod_proxy 来代替。因此,如果某些应用程序出现任何问题,这可能是进一步调查的起点(对我来说,反向代理到 http://localhost:8086 上的 InfluxDB 2.0.3 的 HTTP 端点)。