aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-28 09:57:25 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-28 09:57:25 +0100
commita952acc4347d5d77b3c67283ca6249b49a6c9231 (patch)
tree60f36b7e69cabb0fc0675d08aec7afa08f58c656
parent6533428a7b06fef01bebf1b8f93052884f77ea68 (diff)
downloadNix-a952acc4347d5d77b3c67283ca6249b49a6c9231.tar.gz
Nix-a952acc4347d5d77b3c67283ca6249b49a6c9231.tar.zst
Nix-a952acc4347d5d77b3c67283ca6249b49a6c9231.zip
Cleanup balancers for httpd
Fixes https://git.immae.eu/mantisbt/view.php?id=91
-rw-r--r--nixops/modules/websites/tools/diaspora/default.nix9
-rw-r--r--nixops/modules/websites/tools/ether/default.nix2
-rw-r--r--nixops/modules/websites/tools/mastodon/default.nix24
-rw-r--r--nixops/modules/websites/tools/mediagoblin/default.nix10
4 files changed, 10 insertions, 35 deletions
diff --git a/nixops/modules/websites/tools/diaspora/default.nix b/nixops/modules/websites/tools/diaspora/default.nix
index 8d62c7e..87faee8 100644
--- a/nixops/modules/websites/tools/diaspora/default.nix
+++ b/nixops/modules/websites/tools/diaspora/default.nix
@@ -77,8 +77,7 @@ in {
77 }; 77 };
78 78
79 services.myWebsites.tools.modules = [ 79 services.myWebsites.tools.modules = [
80 "headers" "proxy" "proxy_http" "proxy_balancer" 80 "headers" "proxy" "proxy_http"
81 "lbmethod_byrequests" "lbmethod_bytraffic" "lbmethod_bybusyness" "lbmethod_heartbeat"
82 ]; 81 ];
83 security.acme.certs."eldiron".extraDomains."diaspora.immae.eu" = null; 82 security.acme.certs."eldiron".extraDomains."diaspora.immae.eu" = null;
84 services.myWebsites.tools.vhostConfs.diaspora = { 83 services.myWebsites.tools.vhostConfs.diaspora = {
@@ -88,11 +87,7 @@ in {
88 extraConfig = [ '' 87 extraConfig = [ ''
89 RewriteEngine On 88 RewriteEngine On
90 RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f 89 RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
91 RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L] 90 RewriteRule ^/(.*)$ unix://${diaspora.railsSocket}|http://diaspora.immae.eu/%{REQUEST_URI} [P,NE,QSA,L]
92
93 <Proxy balancer://thinservers>
94 BalancerMember unix://${diaspora.railsSocket}|http://
95 </Proxy>
96 91
97 ProxyRequests Off 92 ProxyRequests Off
98 ProxyVia On 93 ProxyVia On
diff --git a/nixops/modules/websites/tools/ether/default.nix b/nixops/modules/websites/tools/ether/default.nix
index 5ee3433..c4a9932 100644
--- a/nixops/modules/websites/tools/ether/default.nix
+++ b/nixops/modules/websites/tools/ether/default.nix
@@ -75,8 +75,6 @@ in {
75 ProxyPreserveHost On 75 ProxyPreserveHost On
76 ProxyPass / http://localhost:${etherpad.listenPort}/ 76 ProxyPass / http://localhost:${etherpad.listenPort}/
77 ProxyPassReverse / http://localhost:${etherpad.listenPort}/ 77 ProxyPassReverse / http://localhost:${etherpad.listenPort}/
78 ProxyPass /socket.io ws://localhost:${etherpad.listenPort}/socket.io
79 ProxyPassReverse /socket.io ws://localhost:${etherpad.listenPort}/socket.io
80 <Proxy *> 78 <Proxy *>
81 Options FollowSymLinks MultiViews 79 Options FollowSymLinks MultiViews
82 AllowOverride None 80 AllowOverride None
diff --git a/nixops/modules/websites/tools/mastodon/default.nix b/nixops/modules/websites/tools/mastodon/default.nix
index 3740a49..0aaff70 100644
--- a/nixops/modules/websites/tools/mastodon/default.nix
+++ b/nixops/modules/websites/tools/mastodon/default.nix
@@ -135,8 +135,7 @@ in {
135 }; 135 };
136 136
137 services.myWebsites.tools.modules = [ 137 services.myWebsites.tools.modules = [
138 "headers" "proxy" "proxy_wstunnel" "proxy_http" "proxy_balancer" 138 "headers" "proxy" "proxy_wstunnel" "proxy_http"
139 "lbmethod_byrequests" "lbmethod_bytraffic" "lbmethod_bybusyness" "lbmethod_heartbeat"
140 ]; 139 ];
141 security.acme.certs."eldiron".extraDomains."mastodon.immae.eu" = null; 140 security.acme.certs."eldiron".extraDomains."mastodon.immae.eu" = null;
142 services.myWebsites.tools.vhostConfs.mastodon = { 141 services.myWebsites.tools.vhostConfs.mastodon = {
@@ -167,23 +166,10 @@ in {
167 ProxyPassMatch ^(/.*\.(png|ico|gif)$) ! 166 ProxyPassMatch ^(/.*\.(png|ico|gif)$) !
168 ProxyPassMatch ^/(assets|avatars|emoji|headers|packs|sounds|system|.well-known/acme-challenge) ! 167 ProxyPassMatch ^/(assets|avatars|emoji|headers|packs|sounds|system|.well-known/acme-challenge) !
169 168
170 ProxyPassMatch /api/v1/streaming/(.+)$ balancer://node_servers_http/api/v1/streaming/$1 169 RewriteRule ^/api/v1/streaming/(.+)$ unix://${mastodon.nodeSocket}|http://mastodon.immae.eu/api/v1/streaming/$1 [P,NE,QSA,L]
171 ProxyPass /api/v1/streaming/ balancer://node_servers/ 170 RewriteRule ^/api/v1/streaming/$ unix://${mastodon.nodeSocket}|ws://mastodon.immae.eu/ [P,NE,QSA,L]
172 ProxyPassReverse /api/v1/streaming/ balancer://node_servers/ 171 ProxyPass / unix://${mastodon.railsSocket}|http://mastodon.immae.eu/
173 ProxyPass / balancer://puma_servers/ 172 ProxyPassReverse / unix://${mastodon.railsSocket}|http://mastodon.immae.eu/
174 ProxyPassReverse / balancer://puma_servers/
175
176 <Proxy balancer://puma_servers>
177 BalancerMember unix://${mastodon.railsSocket}|http://
178 </Proxy>
179
180 <Proxy balancer://node_servers>
181 BalancerMember unix://${mastodon.nodeSocket}|ws://localhost
182 </Proxy>
183
184 <Proxy balancer://node_servers_http>
185 BalancerMember unix://${mastodon.nodeSocket}|http://localhost
186 </Proxy>
187 173
188 Alias /system ${mastodon.varDir} 174 Alias /system ${mastodon.varDir}
189 175
diff --git a/nixops/modules/websites/tools/mediagoblin/default.nix b/nixops/modules/websites/tools/mediagoblin/default.nix
index 90b115e..54c0478 100644
--- a/nixops/modules/websites/tools/mediagoblin/default.nix
+++ b/nixops/modules/websites/tools/mediagoblin/default.nix
@@ -101,8 +101,7 @@ in {
101 }; 101 };
102 102
103 services.myWebsites.tools.modules = [ 103 services.myWebsites.tools.modules = [
104 "proxy" "proxy_http" "proxy_balancer" 104 "proxy" "proxy_http"
105 "lbmethod_byrequests" "lbmethod_bytraffic" "lbmethod_bybusyness" "lbmethod_heartbeat"
106 ]; 105 ];
107 users.users.wwwrun.extraGroups = [ "mediagoblin" ]; 106 users.users.wwwrun.extraGroups = [ "mediagoblin" ];
108 security.acme.certs."eldiron".extraDomains."mgoblin.immae.eu" = null; 107 security.acme.certs."eldiron".extraDomains."mgoblin.immae.eu" = null;
@@ -136,11 +135,8 @@ in {
136 ProxyPass /theme_static ! 135 ProxyPass /theme_static !
137 ProxyPass /plugin_static ! 136 ProxyPass /plugin_static !
138 ProxyPassMatch ^/.well-known/acme-challenge ! 137 ProxyPassMatch ^/.well-known/acme-challenge !
139 ProxyPass / balancer://paster_server/ 138 ProxyPass / unix://${mediagoblin.socketsDir}/mediagoblin.sock|http://mgoblin.immae.eu/
140 ProxyPassReverse / balancer://paster_server 139 ProxyPassReverse / unix://${mediagoblin.socketsDir}/mediagoblin.sock|http://mgoblin.immae.eu/
141 <Proxy balancer://paster_server>
142 BalancerMember unix://${mediagoblin.socketsDir}/mediagoblin.sock|http://
143 </Proxy>
144 '' ]; 140 '' ];
145 }; 141 };
146 }; 142 };