我在Debian中安装了一个Apache服务器,我使用它作为代理反向到一个包含静态网站的Nginx容器,我将容器的端口80到3002映射到它的工作良好,但是当我访问https://www.example.com时我遇到了问题,它将我重定向到http://www.example.com!我把我的主机设置成这样:
第一个vHost (HTTP)
<VirtualHost *:80>
ServerName example.com
<Location />
Order allow...
</Location>
ProxyRequests Off
ProxyPreserveHost On
#proxy to docker nginx -p 3002:80
ProxyPass / http://localhost:3002
ProxyPassReverse / http://localhost:3002
</VirtualHost>第二个vHost (由Letencrypt创建的HTTPS)
<VirtualHost *:443>
ServerName example.com
<Location />
Order allow...
</Location>
ProxyRequests Off
ProxyPreserveHost On
#proxy to docker nginx -p 3002:80
ProxyPass / http://localhost:3002
ProxyPassReverse / http://localhost:3002
#crt files..
SSLCertificateFile /etc/letsen...
SSLCertificateKeyFile /etc/letsen..
Include /etc/letsencrypt/option...
</VirtualHost>注意事项:docker图像是kyma/docker
发布于 2018-12-21 22:08:30
你需要一个化名来形容www:
ServerName: example.com
ServerAlias: www.example.comhttps://stackoverflow.com/questions/53885840
复制相似问题