我将以下apache2配置用作反向代理:
<Proxy balancer://mycluster>
BalancerMember http://10.93.43.250:80
</Proxy>
<Proxy balancer://api>
BalancerMember http://10.93.43.251:80
ProxyPreserveHost On
ProxyPass "/gitea/" "balancer://mycluster/"
ProxyPassReverse "/gitea/" "balancer://mycluster/"
ProxyPass "/api/" "balancer://api/api/"
ProxyPassReverse "/api/" "balancer://api/api/"
ProxyPass "/swagger/" "balancer://api/swagger/"
ProxyPassReverse "/swagger/" "balancer://api/swagger/"
此配置有什么问题,因为如果我浏览http://example.com/swagger
会得到
Not Found
The requested URL /swagger was not found on this server.
http://example.com/gitea
或http://example.com/api
相同
仅当我在网址中添加最后一个/时才有效:http://example.com/swagger/