[Geoserver-devel] [JIRA] (GEOS-10491) j_spring_security_check returns http instead of https when putting geoserver behind Nginx proxy

Chris Chen created an issue

GeoServer / BugGEOS-10491

j_spring_security_check returns http instead of https when putting geoserver behind Nginx proxy

Issue Type:

BugBug

Affects Versions:

2.18.6, 2.19.6, 2.20.4

Assignee:

Unassigned

Created:

14/May/22 4:38 PM

Priority:

HighHigh

Reporter:

Chris Chen

Hi, I ran into the issue when trying to put geoserver behind Nginx proxy and enabling SSL.

I tried GeoServer version 2.18.6, 2.19.6 and 2.20.4, all got the same issue that, j_spring_security_check returns http://xxxxx/geoserver/web, instead of https://xxxxx/geoserver/web

I’ve updated the web.xml with:

<context-param>
<param-name>PROXY_BASE_URL</param-name>
<param-value>https://xxx.xxxxxxx.com/geoserver</param-value>
</context-param>

Nginx config:

server {
listen 443 ssl;
server_name xxxx.xxxxxx.com;

ssl_certificate /home/cert/7371305__xxxxxx.com.pem;
ssl_certificate_key /home/cert/7371305__xxxxxx.com.key;

location /

{ proxy_pass http://127.0.0.1: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; proxy_redirect off; }

location /geoserver/

{ proxy_pass http://127.0.0.1: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; proxy_redirect off; }

}

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100198-sha1:8950bff)

Atlassian logo