我一直在尝试使用 Docker 和 nginx-proxy,这样我就可以使用 ssl 在同一台机器上托管两个 Web 应用程序(gophish 和 unms)。当我设置好一切并尝试访问网站时,我的浏览器中出现了 ERR_SSL_PROTOCOL_ERROR。我查看了我的证书文件夹,发现它们似乎正在正确生成,正如本文所述,看起来它正在将 SSL 信息添加到 nginx-proxy default.conf 文件中。你们能给出一些建议,说明在哪里可以找到这个问题吗?
sudo docker run -d --name site-b -e '[email protected]' -e 'LETSENCRYPT_HOST=phish.minnesota-title.com' -e 'VIRTUAL_PORT=3333' -e 'VIRTUAL_HOST=phish.minnesota-title.com' matteoggl/gophish
sudo docker run -d --name site-a -e '[email protected]' -e 'LETSENCRYPT_HOST=unms.minnesota-title.com' -e 'VIRTUAL_HOST=unms.minnesota-title.com' httpd
这是我用来创建应用程序容器的两个命令。我将实际的 unms 应用程序替换为 httpd,这样就不会引入其他变量,一旦我让它工作起来,我就应该能够摆弄并让 unms 工作起来。
这是我的 nginx-proxy 容器 default.conf 文件
# phish.minnesota-title.com
upstream phish.minnesota-title.com {
## Can be connected with "bridge" network
# site-b
server 172.17.0.6:3333;
}
server {
server_name phish.minnesota-title.com;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
return 301 https://$host$request_uri;
}
server {
server_name phish.minnesota-title.com;
listen 443 ssl http2 ;
access_log /var/log/nginx/access.log vhost;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_certificate /etc/nginx/certs/phish.minnesota-title.com.crt;
ssl_certificate_key /etc/nginx/certs/phish.minnesota-title.com.key;
ssl_dhparam /etc/nginx/certs/phish.minnesota-title.com.dhparam.pem;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/nginx/certs/phish.minnesota-title.com.chain.pem;
add_header Strict-Transport-Security "max-age=31536000" always;
include /etc/nginx/vhost.d/default;
location / {
proxy_pass http://phish.minnesota-title.com;
}
}
# unms.minnesota-title.com
upstream unms.minnesota-title.com {
## Can be connected with "bridge" network
# site-a
server 172.17.0.5:80;
}
server {
server_name unms.minnesota-title.com;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
return 301 https://$host$request_uri;
}
server {
server_name unms.minnesota-title.com;
listen 443 ssl http2 ;
access_log /var/log/nginx/access.log vhost;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_certificate /etc/nginx/certs/unms.minnesota-title.com.crt;
ssl_certificate_key /etc/nginx/certs/unms.minnesota-title.com.key;
ssl_dhparam /etc/nginx/certs/unms.minnesota-title.com.dhparam.pem;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/nginx/certs/unms.minnesota-title.com.chain.pem;
add_header Strict-Transport-Security "max-age=31536000" always;
include /etc/nginx/vhost.d/default;
location / {
proxy_pass http://unms.minnesota-title.com;
}
}
你们能提供的任何帮助都将是天赐之物!如果您需要查看我尚未发布的内容,请告诉我,我可以获取它!