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.
- 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
/visortraffic 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.
- Listens on
http://0.0.0.0:3000. - Accepts requests starting with
/visor(override withINCOMING_BASE_PATH). - Forwards only key WMS operations (
GetMap,GetLegendGraphic,GetCapabilities, etc.) to the target GeoServer defined byWMS_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.
| 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).
- Install Application Request Routing (ARR) and URL Rewrite modules in IIS if not already present.
- Open Server Proxy Settings and enable proxy in ARR.
- Add a new inbound rule in URL Rewrite:
- Pattern:
^visor(.*) - Action type: Rewrite →
http://localhost:3000/visor{R:1} - Preserve host header enabled.
- Pattern:
- Bind your HTTPS certificate to the IIS site; the proxy only receives HTTP from IIS on the LAN.
npm install
npm startFor services, install PM2 globally (npm install -g pm2) and run:
pm2 start main.js --name geoserver-proxy
pm2 savePM2 can also watch the process or load environment variables via --env-file.
- Monitor the proxy logs for unexpected status codes; the proxy returns
400when therequestparameter is not a known WMS command. - Add your preferred authentication or rate limiting before the request is proxied to GeoServer.