diff options
-rw-r--r-- | nixops/modules/websites/tools/peertube.nix | 15 |
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 | }; |