【发布时间】:2019-05-21 23:43:12
【问题描述】:
我在 Debian VPS 中安装了 Apache 服务器,我将其用作 Nginx 容器的代理反向包含静态网站,我将容器的端口 80 映射到 3002 并且它运行良好,但是当我访问 @ 时出现问题987654321@ 它将我重定向到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 Bot 创建的 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-nginx
【问题讨论】:
标签: apache docker nginx reverse-proxy lets-encrypt