我已经为 Datastax 编写的名为 OpsCenter 的 Cassandra 监控工具设置了一个基本代理。该应用程序是一个侦听 8888/8443 的 python 网络服务器。该应用程序不以 root 身份运行,因此无法在 80/443 上绑定,所以我想在前面运行 Apache 作为代理/反向代理。我遇到的问题是 OpsCenter 在每次请求后重写 URI,并写入端口。
例如https://mydomain.com/在每次请求后变为https://mydomain.com:8443/ 。这会阻止所有未来的请求工作,因为 8443 未在防火墙上打开。
当向客户端返回响应时,Apache 可以从 URI 中删除端口吗?
这是我的代理配置的样子。我正在代理处进行 SSL 终止。
ProxyRequests Off
ProxyPreserveHost On # OpsCenter also rewrites the host, which becomes 127.0.0.1 without this.
SSLEngine On
SSLProxyEngine On
SSLCertificateFile "/path/to/cert"
SSLCertificateKeyFile "/path/to/key"
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerExpire Off
ProxyPass /tcp http://127.0.0.1:8888/tcp
ProxyPassReverse /tcp http://127.0.0.1:8888/tcp
ProxyPass /opscenter http://127.0.0.1:8888
ProxyPassReverse /opscenter http://127.0.0.1:8888