aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/websites/tools/mastodon/default.nix
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 /nixops/modules/websites/tools/mastodon/default.nix
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
Diffstat (limited to 'nixops/modules/websites/tools/mastodon/default.nix')
-rw-r--r--nixops/modules/websites/tools/mastodon/default.nix24
1 files changed, 5 insertions, 19 deletions
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