I have kartoza/geoserver that I start with this docker-compose:
version: "3.9"
services:
geoserver:
image: kartoza/geoserver
environment:
- GEOSERVER_ADMIN_USER
- GEOSERVER_ADMIN_PASSWORD
- GEOSERVER_CSRF_DISABLED=true
- JAVA_OPTS
#- PROXY_BASE_URL
running behind Nginx with these configurations:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name geos.mydomain.com;
ssl_certificate /etc/nginx/ssl/cert/geoserver/geoserver.crt;
ssl_certificate_key /etc/nginx/ssl/cert/geoserver/geoserver.rsa;
location /geoserver/ {
proxy_pass http://geoserver:8080/geoserver/;
proxy_pass_header Set-Cookie;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
I can see the geoserver page:
But when I try to login it fails:
Why? How can I solve it?
1条答案
按热度按时间s3fp2yjn1#
As mazano said:
Looks like you are running with HTTPS so you need to set the following env variables
after setting these variables everything works fine!