From c24b0e87f71ecd128ba642bd4f5a0d2767889cf1 Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 19 Aug 2025 16:42:30 +0200 Subject: [PATCH] example nginx config --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index ddb06a4..87e2fcf 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,37 @@ authentication: After a successful login, whiskr issues a signed (HMAC-SHA256) token, using the server secret (`tokens.secret` in `config.yml`). This is stored as a cookie and re-used for future authentications. +## Nginx (optional) + +When running behind a reverse proxy like nginx, you can have the proxy serve static files. + +```ngnix +server { + listen 443 ssl; + server_name chat.example.com; + http2 on; + + root /path/to/whiskr/static; + + location / { + index index.html index.htm; + + etag on; + add_header Cache-Control "public, max-age=2592000, must-revalidate"; + expires 30d; + } + + location ~ ^/- { + proxy_pass http://127.0.0.1:3443; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + } + + ssl_certificate /path/to/cert.pem; + ssl_certificate_key /path/to/key.pem; +} +``` + ## Usage - Send a message with `Ctrl+Enter` or the send button