From 7c9c55c9220d8345769b5d91ccada13dcab6ba6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Rodr=C3=ADguez?= Date: Sun, 14 Jan 2024 21:39:06 -0500 Subject: [PATCH 1/2] Give sample reverse proxy config --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index e052f74..aefc97f 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,24 @@ then just run it with some environment variables for configuration. A reverse proxy configured to allow websockets should be pointed at the RELAY_LISTEN port to enable TLS. The bridge and registration providers can then be pointed at the public address of the reverse proxy. + +For example, if using `nginx`, the following configuration can be used: + +```nginx +location /health { + proxy_pass http://127.0.0.1:8000; +} + +location /api/v1/provider { + proxy_pass http://127.0.0.1:8000; + # https://www.nginx.com/blog/websocket-nginx/ + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; +} + +location /api/v1/bridge { + proxy_pass http://127.0.0.1:8000; +} +``` From 9cd14875eb43486d4ae48fd3d19fc7c06dd859c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Rodr=C3=ADguez?= Date: Mon, 15 Jan 2024 00:20:24 -0500 Subject: [PATCH 2/2] add websocket proxying to other endpoint --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index aefc97f..f1267ad 100644 --- a/README.md +++ b/README.md @@ -35,5 +35,10 @@ location /api/v1/provider { location /api/v1/bridge { proxy_pass http://127.0.0.1:8000; + # https://www.nginx.com/blog/websocket-nginx/ + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; } ```