From 3330fed78f3201fbc55d4d863d3564f8ae1ae347 Mon Sep 17 00:00:00 2001 From: Sven Frotscher <67124493+sven-frotscher@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:18:04 +0200 Subject: [PATCH] Update Nginx reverse proxy config example Omitting trailing slashes in Nginx' `proxy_pass` directives causes redirect loops (see #1024), while the "issue" described in the warning is caused by an incorrect URL. Fixes: 74b573e Signed-off-by: Sven Frotscher <67124493+sven-frotscher@users.noreply.github.com> --- docs/content/guides/reverse-proxy.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/content/guides/reverse-proxy.md b/docs/content/guides/reverse-proxy.md index 6298a4c9d..4db445cb6 100644 --- a/docs/content/guides/reverse-proxy.md +++ b/docs/content/guides/reverse-proxy.md @@ -64,7 +64,7 @@ server { server_name hedgedoc.example.com; location / { - proxy_pass http://127.0.0.1:3000; + proxy_pass http://127.0.0.1:3000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -72,7 +72,7 @@ server { } location /socket.io/ { - proxy_pass http://127.0.0.1:3000; + proxy_pass http://127.0.0.1:3000/socket.io/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -92,10 +92,11 @@ server { !!! warning - NGINX `proxy_pass` directives must NOT have trailing slashes. If the trailing - slashes are present, the browser will not be able to establish a WebSocket - connection to the server, and the editor interface will display an endless loading - animation. + NGINX `proxy_pass` directives must have trailing slashes. If the trailing + slashes are not present, clients will get stuck in a redirect loop. + If `/socket.io/` is not present in the second `proxy_pass` line, the + browser will not be able to establish a WebSocket connection to the server, + and the editor interface will display an endless loading animation. ### Apache You will need these modules enabled: `proxy`, `proxy_http` and `proxy_wstunnel`.