我有一个apache站点,它使用代理将所有的“/api”重定向到spring启动应用程序。问题是我打电话的时候https://www.my-site.com/api/foo 我得到一个401错误,但是如果我直接打电话http://my.server.ip:8080/api它工作得很好,我认为这与apache代理配置有关,下面是我的虚拟主机:
<VirtualHost *:80>
ServerAdmin admin@my-site.com
ServerName my-site.com
ServerAlias www.my-site.com
DocumentRoot /var/www/my-site.com
Redirect permanent / https://www.my-site.com/
</VirtualHost>
<VirtualHost *:443>
ServerName my-site.com
ServerAlias www.my-site.com
DocumentRoot /var/www/my-site.com
<If "%{HTTP_HOST} == 'my-site.com'">
Redirect permanent / https://www.my-site.com/
</If>
ProxyPreserveHost On
ProxyRequests Off
ProxyPass "/api" "http://localhost:8080"
ProxyPassReverse "/api" "http://localhost:8080"
SSLEngine On
SSLCertificateFile /etc/ssl/...
SSLCertificateKeyFile /etc/ssl/...
SSLCertificateChainFile /etc/ssl/...
</VirtualHost>
暂无答案!
目前还没有任何答案,快来回答吧!