Geoserver behing nginx partially working

Hi I am trying to serve the geoserver content behind a nginx https server, the config is the following, my idea is to server all content in https and restrict the access to the admin area to some IPS (allow_pro.conf)
On the first block I redirect all the requests to https so no plai content goes through

server {
        listen 80;
        server_name geoserverpub.example.com;
    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443;
    server_name geoserverpub.example.com;
    access_log /var/log/nginx/geoserverpub.access.log upstreamlog;

    location /geoserver/ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass http://geoserverpub.example.net:8080/geoserver/;
        proxy_redirect off;
        location /geoserver/web/ {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_redirect off;
            proxy_pass http://geoserverpub.example.net:8080/geoserver/web/;
            include /etc/nginx/snippets/allow_pro.conf;
        }
    }
}

The problem is that many of the links inside the html are non relative and I get alerts about the insecure content, for example the links to http://geoserverpub.example.com/geoserver/j_spring_security_check

On many web applications you can define the public URL for the service, so the URL will work behind a web server.
Is that possible with geoserver?

I’ve seen some related issues but couldn’t find a definite answer and most of them are quite old:

Hi,

Have you seen the Proxy base url setting Global Settings — GeoServer 2.27.x User Manual?

-Jukka Rahkonen-

Hi @jratike80 it was this, I read about this on another issue but I was confuse about the meaning of PROXY in this context.
Everything work now, thanks a lot