X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=nixops%2Fmodules%2Fwebsites%2Ftools%2Fpeertube.nix;h=a9f06cca47699b517b73ab0aa24ec8d0cd9a78ed;hp=ab5e08a18c27f8517e7e8de0b67e36059bc3f6f8;hb=f826c67c0ff51c9724e8f54da6c9cbef78977858;hpb=5af8d43b9ee0543ff212e5c51fb0e750a2b83955 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 { hosts = [ "peertube.immae.eu" ]; root = null; extraConfig = [ '' + RewriteEngine On + + RewriteCond %{REQUEST_URI} ^/socket.io [NC] + RewriteCond %{QUERY_STRING} transport=websocket [NC] + RewriteRule /(.*) ws://localhost:${env.listenPort}/$1 [P,NE,QSA,L] + + RewriteCond %{REQUEST_URI} ^/tracker/socket [NC] + RewriteRule /(.*) ws://localhost:${env.listenPort}/$1 [P,NE,QSA,L] + ProxyPass / http://localhost:${env.listenPort}/ ProxyPassReverse / http://localhost:${env.listenPort}/ ProxyPreserveHost On RequestHeader set X-Real-IP %{REMOTE_ADDR}s - - ProxyPass /tracker/socket ws://127.0.0.1:${env.listenPort}/tracker/socket - ProxyPassReverse /tracker/socket ws://127.0.0.1:${env.listenPort}/tracker/socket - - ProxyPass /socket.io ws://127.0.0.1:${env.listenPort}/socket.io - ProxyPassReverse /socket.io ws://127.0.0.1:${env.listenPort}/socket.io '' ]; }; };