OrcaCD LogoOrcaCD

Reverse Proxy

Learn how to use a reverse proxy with OrcaCD

In a production environment, it is strongly recommended to run the OrcaCD Hub behind a reverse proxy with a domain and a valid TLS certificate.

Adjust configuration

Make sure to adjust the TRUSTED_PROXIES environment variable to include the IP address of your reverse proxy, otherwise the Hub will not be able to determine the correct client IP address. You will also need to set the public URL in the hub and agent environment variables.

Nginx

To use Nginx as a reverse proxy for OrcaCD, expose the Hub on localhost only and forward traffic from your public domain to the Hub port.

Use this server block in your Nginx config:

server {
  listen 80;
  server_name orcacd.example.com;

  location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_http_version 1.1;

    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Port  $server_port;

    # Required for WebSocket connections.
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    # Prevent Websocket being closed by Nginx
    proxy_send_timeout                 120s;
    proxy_read_timeout                 120s;
  }
}

Caddy

To use Caddy as a reverse proxy for OrcaCD, add the following to your Caddyfile:

orcacd.example.com {
  reverse_proxy 127.0.0.1:8080
}

Traefik

To use Traefik as a reverse proxy for OrcaCD, you can add the following labels to your Docker Compose configuration for the OrcaCD Hub service:

services:
  hub:
    image: ghcr.io/orcacd/hub:latest
    container_name: orca-hub
    ports:
      - "127.0.0.1:8080:8080"
    restart: unless-stopped
    env_file: .env
    labels: 
      - "traefik.enable=true"
      - "traefik.http.routers.orcacd.rule=Host(`orcacd.example.com`)"
    volumes:
      - ./data/hub:/app/data

Last updated on

On this page