Skip to main content
Version: 5.2

Reverse-Proxy (Traefik, nginx, etc.)

To operate the OPC Router in Docker behind a reverse proxy like Traefik or nginx, certain settings need to be configured. It's important to note that the OPC Router uses both HTTP and WebSocket connections, which must be correctly forwarded by the reverse proxy.

note

This section describes only the necessary steps for web management. Additional adjustments may be required for the REST server or other plugins.

tip

To optimize network performance, we recommend enabling SSL offloading in the reverse proxy rather than in the OPC Router, especially when network traffic between the reverse proxy and the OPC Router can be considered secure.

Path Prefix

To access the OPC Router through a reverse proxy with a path prefix, two environment variables must be set. The WEB_BASE_PATH environment variable specifies the path prefix used by the reverse proxy. The ASPNETCORE_FORWARDEDHEADERS_ENABLED environment variable must be set to true to allow the OPC Router to process header information forwarded by the reverse proxy.

Example Traefik configuration:

docker run ... \
-e "WEB_BASE_PATH=/opc-router"
-e ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
--label "traefik.http.routers.reverse-proxy.rule=PathPrefix(/opc-router)"

Hostname

To make the OPC Router accessible under a specific hostname, you can set up a reverse proxy. Ensure that the reverse proxy host itself is reachable at the specified DNS address. Additionally, the ASPNETCORE_FORWARDEDHEADERS_ENABLED environment variable must be set to true to enable the OPC Router to correctly process header information from the reverse proxy.