cambridge-cares / TheWorldAvatar

A knowledge-graph-based digital twin of the world.
https://theworldavatar.io/
MIT License
77 stars 23 forks source link

Fix GeoServer web UI when behind a reverse proxy #1252

Open gpeb2 opened 4 weeks ago

gpeb2 commented 4 weeks ago

Currently the GeoServer web UI doesn't work behind a reverse proxy.

Part of the fix is to change the value of the "proxyBaseUrl" set in the GeoServerService::updateSettings method to: "${X-Forwarded-Proto}://${X-Forwarded-Host}${X-Forwarded-Path}/geoserver". This fixes the slashes and adds the GeoServer specific X-Forwarded-Path variable. The X-Forwarded-Path variable also needs to be added to the Nginx config for the GeoServer "location", something like this: proxy_set_header X-Forwarded-Path $http_x_forwarded_path; defaulting to the requested path by default.