Apache反向代理子域到端口
我正在尝试设置一个apache反向代理以获得以下结果 预期结果 访问Apache反向代理子域到端口,apache,ubuntu,networking,reverse-proxy,Apache,Ubuntu,Networking,Reverse Proxy,我正在尝试设置一个apache反向代理以获得以下结果 预期结果 访问https://service.example.com,apache将提供http://localhost:8080,这是在本地主机上运行的另一个服务/Web服务器 实际结果 访问https://service.example.comapache从https://example.com(并给出了一些证书问题) 当前配置 有一个SSL apache服务器正在https://example.com使用一个lets加密通配符证书 应该
https://service.example.com
,apache将提供http://localhost:8080
,这是在本地主机上运行的另一个服务/Web服务器
实际结果
访问https://service.example.com
apache从https://example.com
(并给出了一些证书问题)
当前配置
有一个SSL apache服务器正在https://example.com
使用一个lets加密通配符证书
应该启用反向代理的虚拟主机文件如下所示
<VirtualHost *:80>
ServerName service.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080
ProxyPassReverse / http://localhost:8080
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
ServerName service.example.com
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
代理请求关闭
命令拒绝,允许
通融
ProxyPass/http://localhost:8080
ProxyPassReverse/http://localhost:8080
命令允许,拒绝
通融
该文件已通过a2ensite service.conf激活,并启用了指向/站点的符号链接
如何解决这个问题?非常感谢您的帮助。如果问题仍然相关,您在域的末尾缺少斜杠:
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
另外,不要忘记启用代理模块:a2enmod proxy_http