Skip to content

Reverse Proxy Settings nginx

Loris Sauter edited this page May 13, 2022 · 1 revision

server {
  server_name HOST;

  listen 443 ssl http2; # managed by Certbot
  ssl_certificate SOME/PATH/  # managed by Certbot
  ssl_certificate_key SOME/PATH/ # managed by Certbot
  include SOME/PATH/ # managed by Certbot
  ssl_dhparam SOME/PATH/ # managed by Certbot

  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-Proto https;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_set_header X-Forwarded-Host $remote_addr;

  proxy_redirect off;
  proxy_connect_timeout 1h;
  proxy_send_timeout 1h;
  proxy_read_timeout 1h;
  send_timeout 1h;

  # Required for viewer to have WS updates
  location /api/ws/run {
    proxy_pass http://localhost:8080;

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_http_version 1.1;
    proxy_ssl_session_reuse off;
  }

  location / {
    proxy_pass http://localhost:8080;

    proxy_cookie_path / "/; HttpOnly; secure; SameSite=None";
  }
}

Clone this wiki locally