![此连接不安全。此处输入的登录信息可能被盗用](https://linux22.com/image/784300/%E6%AD%A4%E8%BF%9E%E6%8E%A5%E4%B8%8D%E5%AE%89%E5%85%A8%E3%80%82%E6%AD%A4%E5%A4%84%E8%BE%93%E5%85%A5%E7%9A%84%E7%99%BB%E5%BD%95%E4%BF%A1%E6%81%AF%E5%8F%AF%E8%83%BD%E8%A2%AB%E7%9B%97%E7%94%A8.png)
这是在使用 Jetty/Java 的 Geoserver 上进行的。我遵循这在 Debian 机器上阅读了本文,然后使用 Certbot 添加 SSL(我的挂锁没问题)。信息当我单击用户/密码输入框时出现。这似乎是混合内容警告,但我不知道需要更改哪些 Nginx 或 Geoserver 配置。我有 v2.22.2。
server {
server_name mydomain.com www.mydomain.com;
location / {
proxy_pass http://127.0.0.1:8080;
include proxy_params;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
}
server {
if ($host = mydomain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name mydomain.com www.mydomain.com;
return 404; # managed by Certbot
location / {
# root /path/to/myapp/public;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://172.0.0.1:8080;
}
add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
}