From 1a77a46444d2e1c494aa329fbb63b425dbe49cdb Mon Sep 17 00:00:00 2001 From: Elias Renman Date: Fri, 26 Jun 2026 14:09:31 +0200 Subject: [PATCH] Add nginx example config --- README.md | 2 +- example-nginx.conf | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 example-nginx.conf diff --git a/README.md b/README.md index d0966fa..a4969ed 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The relay listens on `127.0.0.1:8085` through Docker's published port, and manag Nginx should terminate HTTPS. The relay container is patched to run as a plain HTTP/WebSocket backend and should not handle Let's Encrypt itself. -Use plain `http://` upstreams: +Use plain `http://` upstreams. A standalone template is available in `example-nginx.conf`: ```nginx server { diff --git a/example-nginx.conf b/example-nginx.conf new file mode 100644 index 0000000..af44e91 --- /dev/null +++ b/example-nginx.conf @@ -0,0 +1,51 @@ +server { + listen 80; + listen [::]:80; + + server_name DOMAIN *.DOMAIN; + + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name DOMAIN *.DOMAIN; + + ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem; + + location = /ws { + proxy_pass http://127.0.0.1:8085/ws; + + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header Authorization $http_authorization; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_read_timeout 3600s; + proxy_send_timeout 3600s; + } + + location /api/ { + proxy_pass http://127.0.0.1:6468/api/; + + proxy_http_version 1.1; + proxy_set_header 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; + } + + location / { + proxy_pass http://127.0.0.1:8085; + + proxy_http_version 1.1; + proxy_set_header 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; + } +}