Skip to content

elherzt/NodeProxyGeoServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GeoServer Proxy

Node.js reverse proxy that serves GeoServer content on port 3000 while the upstream GeoServer stays hidden on 9001. Designed to fit Windows legacy stacks where IIS already fronts the network.

GeoServer is an open-source map server that publishes spatial data through OGC services such as WMS and WFS. It usually runs on Jetty or Tomcat and often sits behind other web servers.

Why this project

  • Keeps the GeoServer JVM port off the internet while still sharing its layers.
  • Leaves space for modern security (JWT, SSO, custom middlewares) without hardcoding the choice.
  • Makes SSL handling easier by letting IIS take the certificate and forward only /visor traffic to Node.
  • Especially useful on aging Windows servers where IIS and GeoServer must coexist.

Modern container-first stacks can place GeoServer behind nginx or Traefik directly. For Windows installations with IIS, this proxy adds an extra safety layer with minimum changes.

How it works

  • Listens on http://0.0.0.0:3000.
  • Accepts requests starting with /visor (override with INCOMING_BASE_PATH).
  • Forwards only key WMS operations (GetMap, GetLegendGraphic, GetCapabilities, etc.) to the target GeoServer defined by WMS_TARGET.
  • Rewrites the path to include WMS_PREFIX (default /geoserver) before calling the upstream service.
  • Optional basic-auth helper is commented out so teams can replace it with their own JWT/SSO modules.

Configuration

Variable Default Purpose
PORT 3000 Port exposed by the Node proxy.
INCOMING_BASE_PATH /visor Path IIS should forward to Node.
WMS_TARGET http://localhost:9001 GeoServer base URL (Jetty/Tomcat).
WMS_PREFIX /geoserver Prefix added before the forwarded path.
AUTH_USER / AUTH_PASSWORD (unused) Enable the basic-auth stub if you really need it for tests.

Set environment variables on Windows through System Properties → Environment Variables (stored in the registry) or with command line tools like setx PORT 3000. For per-app settings you can create a .env file and load it with your process manager (e.g. pm2 start main.js --env-file .env).

IIS reverse proxy setup

  1. Install Application Request Routing (ARR) and URL Rewrite modules in IIS if not already present.
  2. Open Server Proxy Settings and enable proxy in ARR.
  3. Add a new inbound rule in URL Rewrite:
    • Pattern: ^visor(.*)
    • Action type: Rewritehttp://localhost:3000/visor{R:1}
    • Preserve host header enabled.
  4. Bind your HTTPS certificate to the IIS site; the proxy only receives HTTP from IIS on the LAN.

Running the proxy

npm install
npm start

For services, install PM2 globally (npm install -g pm2) and run:

pm2 start main.js --name geoserver-proxy
pm2 save

PM2 can also watch the process or load environment variables via --env-file.

Notes

  • Monitor the proxy logs for unexpected status codes; the proxy returns 400 when the request parameter is not a known WMS command.
  • Add your preferred authentication or rate limiting before the request is proxied to GeoServer.

About

Basic node proxy for GeoServer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published