Skip to main content
Version: 5.6

Reverse proxy (Traefik, nginx, etc)

See also:

HTTP(s) failover concepts for REST, OPC UA Server & WebManagement in OPC Router

To run OPC Router in Docker behind a reverse proxy such as Traefik or nginx, a few settings must be configured. Please note that OPC Router uses both HTTP and WebSocket connections, which must be forwarded correctly by the reverse proxy.

note

This section only describes the steps necessary for web management. Further adjustments may be necessary for the REST server or other plug-ins.

tip

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

Path prefix

To access the OPC Router via a reverse proxy with a path prefix, two environment variables must be set. The environment variable WEB_BASE_PATH specifies the path prefix used by the reverse proxy. The environment variable ASPNETCORE_FORWARDEDHEADERS_ENABLED must be set to true so that the OPC Router can process the header information transmitted 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. You must ensure that the reverse proxy host itself is accessible under the specified DNS address. In addition, the environment variable ASPNETCORE_FORWARDEDHEADERS_ENABLED must be set to true so that the OPC Router can correctly process the header information of the reverse proxy.