GeoServer behind NGINX Reverse Proxy – 400 “Origin does not match” Error When Using UI

Hi everyone,

I’m relatively new to deploying GeoServer in a production-like environment and I’m hoping to get some help from the community.

I’ve successfully installed GeoServer inside a Docker container on an Ubuntu server. I’ve also set up an NGINX reverse proxy to expose it through our domain. I can access the GeoServer web interface just fine and can log in as an admin without any issues.

However, I’m running into a roadblock: whenever I try to perform actions through the GeoServer UI (like saving changes or configuring settings), I receive a 400 - Origin does not match error.

I’ve been digging into this and I suspect it might be related to proxy headers or proxy base URL. So I tried setting the right proxy headers and also proxy base URL in a file inside GeoServer data but I could not make it work. I’d greatly appreciate any guidance on how to resolve this—or even just pointers to the right configuration settings or documentation.

Here are a few relevant details:

  • GeoServer is running in Docker.
  • Hosted on Ubuntu Server.
  • Exposed using NGINX as a reverse proxy.
  • Accessed via a domain/geoserver.

If any additional information would help troubleshoot, I’d be more than happy to provide it.

Thanks in advance for your time and help—looking forward to learning from you all!

Best regards,
Khawaja Haider

Hi @TheDesignerKhawaja

Welcome to the forum. Have you tried the solutions mentioned here: 2.27.1 New data source page not working and Geoserver behing nginx partially working - #2 by jratike80?

Let us know what you have tried and what the exact symptoms are.

Peter