aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-11 01:48:52 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-11 01:48:52 +0200
commitf826c67c0ff51c9724e8f54da6c9cbef78977858 (patch)
treea6fefdcba16a0ad2217dee3ce384690d71754fd0
parent5af8d43b9ee0543ff212e5c51fb0e750a2b83955 (diff)
downloadNix-f826c67c0ff51c9724e8f54da6c9cbef78977858.tar.gz
Nix-f826c67c0ff51c9724e8f54da6c9cbef78977858.tar.zst
Nix-f826c67c0ff51c9724e8f54da6c9cbef78977858.zip
Fix peertube websockets
-rw-r--r--nixops/modules/websites/tools/peertube.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/nixops/modules/websites/tools/peertube.nix b/nixops/modules/websites/tools/peertube.nix
index ab5e08a..a9f06cc 100644
--- a/nixops/modules/websites/tools/peertube.nix
+++ b/nixops/modules/websites/tools/peertube.nix
@@ -159,17 +159,20 @@ in {
159 hosts = [ "peertube.immae.eu" ]; 159 hosts = [ "peertube.immae.eu" ];
160 root = null; 160 root = null;
161 extraConfig = [ '' 161 extraConfig = [ ''
162 RewriteEngine On
163
164 RewriteCond %{REQUEST_URI} ^/socket.io [NC]
165 RewriteCond %{QUERY_STRING} transport=websocket [NC]
166 RewriteRule /(.*) ws://localhost:${env.listenPort}/$1 [P,NE,QSA,L]
167
168 RewriteCond %{REQUEST_URI} ^/tracker/socket [NC]
169 RewriteRule /(.*) ws://localhost:${env.listenPort}/$1 [P,NE,QSA,L]
170
162 ProxyPass / http://localhost:${env.listenPort}/ 171 ProxyPass / http://localhost:${env.listenPort}/
163 ProxyPassReverse / http://localhost:${env.listenPort}/ 172 ProxyPassReverse / http://localhost:${env.listenPort}/
164 173
165 ProxyPreserveHost On 174 ProxyPreserveHost On
166 RequestHeader set X-Real-IP %{REMOTE_ADDR}s 175 RequestHeader set X-Real-IP %{REMOTE_ADDR}s
167
168 ProxyPass /tracker/socket ws://127.0.0.1:${env.listenPort}/tracker/socket
169 ProxyPassReverse /tracker/socket ws://127.0.0.1:${env.listenPort}/tracker/socket
170
171 ProxyPass /socket.io ws://127.0.0.1:${env.listenPort}/socket.io
172 ProxyPassReverse /socket.io ws://127.0.0.1:${env.listenPort}/socket.io
173 '' ]; 176 '' ];
174 }; 177 };
175 }; 178 };