这是在使用 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';
}