From e1b46dc504a0943676cec7b39f90a351ede24802 Mon Sep 17 00:00:00 2001 From: Nico Isenbeck Date: Sat, 11 Nov 2023 16:24:06 +0100 Subject: [PATCH] Updated webserver sample configs --- webserver/Apache-VirtualHost.example.conf | 5 +---- webserver/Nginx-VirtualHost.example.conf | 14 ++------------ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/webserver/Apache-VirtualHost.example.conf b/webserver/Apache-VirtualHost.example.conf index 350f477..db03155 100644 --- a/webserver/Apache-VirtualHost.example.conf +++ b/webserver/Apache-VirtualHost.example.conf @@ -18,10 +18,7 @@ CustomLog ${APACHE_LOG_DIR}/vaultwarden-access.log combined # Reverse Proxy - RewriteEngine On - RewriteCond %{HTTP:Upgrade} =websocket [NC] - RewriteRule /notifications/hub(.*) ws://127.0.0.1:3012/$1 [P,L] - ProxyPass / http://127.0.0.1:8000/ + ProxyPass / http://127.0.0.1:8000/ upgrade=websocket ProxyPreserveHost On ProxyRequests Off diff --git a/webserver/Nginx-VirtualHost.example.conf b/webserver/Nginx-VirtualHost.example.conf index 87cf040..13604b6 100644 --- a/webserver/Nginx-VirtualHost.example.conf +++ b/webserver/Nginx-VirtualHost.example.conf @@ -28,20 +28,10 @@ server { resolver_timeout 5s; location / { - proxy_pass http://127.0.0.1:8000; - 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 /notifications/hub { - proxy_pass http://127.0.0.1:3012; + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } + proxy_set_header Connection $connection_upgrade; - location /notifications/hub/negotiate { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;