From 876d6cab2fcf96d3918f11e40c4093c8544ec5a3 Mon Sep 17 00:00:00 2001 From: Raine Date: Fri, 10 Nov 2023 21:31:16 +0100 Subject: [PATCH] fix: ws for cryptpad --- .../custom/nginx/conf.d/cryptpad.conf | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/servers/kid/docker-compose.d/custom/nginx/conf.d/cryptpad.conf b/servers/kid/docker-compose.d/custom/nginx/conf.d/cryptpad.conf index c5821e4..6962419 100644 --- a/servers/kid/docker-compose.d/custom/nginx/conf.d/cryptpad.conf +++ b/servers/kid/docker-compose.d/custom/nginx/conf.d/cryptpad.conf @@ -2,8 +2,21 @@ server { listen 80; server_name pad.ixvd.net; + location ^~ /cryptpad_websocket { + proxy_pass http://cryptpad; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # WebSocket support (nginx 1.4) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + } + + location / { - proxy_set_header Host $host; + proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_pass http://cryptpad; } @@ -13,8 +26,21 @@ server { listen 80; server_name sandbox.pad.ixvd.net; + location ^~ /cryptpad_websocket { + proxy_pass http://cryptpad; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # WebSocket support (nginx 1.4) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection upgrade; + } + + location / { - proxy_set_header Host $host; + proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_pass http://cryptpad; }