![Apache 代理传递返回 403 禁止访问](https://linux22.com/image/734653/Apache%20%E4%BB%A3%E7%90%86%E4%BC%A0%E9%80%92%E8%BF%94%E5%9B%9E%20403%20%E7%A6%81%E6%AD%A2%E8%AE%BF%E9%97%AE.png)
我想将 VirtualHost 添加到在 centos 7 上运行的现有 apache 2.4 反向代理,但遇到导致错误 403 的问题。
我有以下 VirtualHost 设置
<VirtualHost *:80>
ServerName newhost.example.com
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule ^(/(.*))?$ https://%{HTTP_HOST}/$1 [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName newhost.example.com
SSLEngine On
ProxyPreserveHost On
ProxyRequests Off
SSLProxyEngine On
ProxyPass /service1 http://172.20.100.138:8989/
ProxyPassReverse /service1 http://172.20.100.138:8989/
ProxyPass /service2 http://172.20.100.138:9191/
ProxyPassReverse /service2 http://172.20.100.138:9191/
</VirtualHost>
当在浏览器中打开 newhost.example.com/service1 时,我收到错误 403 禁止。
如果我将 proxypass 行更改为
ProxyPass / http://172.20.100.138:8989/
ProxyPassReverse / http://172.20.100.138:8989/
打开 newhost.example.com 我能够访问 service1 而不会出现任何错误。
有人能告诉我要添加什么才能使其与 /service1 和 /service2 一起工作吗?