This repository has no description
2.9 kB
94 lines
1{ self, pkgs, ... }:
2{
3 # POST → ipfs-upload backend (writes file to /var/lib/ipfs/download/<path>
4 # and returns the CID). Anything else → the kubo gateway.
5 services.nginx.upstreams.ipfs-gateway.servers."127.0.0.1:8089" = { };
6 services.nginx.upstreams.ipfs-upload.servers."127.0.0.1:8090" = { };
7 services.nginx.appendHttpConfig = ''
8 map $request_method $ipfs_lassul_upstream {
9 default ipfs-gateway;
10 POST ipfs-upload;
11 }
12 '';
13
14 services.nginx.virtualHosts."ipfs.lassul.us" = {
15 forceSSL = true;
16 enableACME = true;
17 locations."/" = {
18 proxyPass = "http://$ipfs_lassul_upstream";
19 recommendedProxySettings = true;
20 extraConfig = ''
21 client_max_body_size 0;
22 proxy_request_buffering off;
23 proxy_read_timeout 1h;
24 proxy_send_timeout 1h;
25 '';
26 };
27 };
28 services.nginx.virtualHosts."flix.lassul.us" = {
29 forceSSL = true;
30 enableACME = true;
31 locations."/" = {
32 # jellyfin only listens on IPv4; yellow.r also resolves to its
33 # retiolum AAAA, which nginx round-robins into -> intermittent
34 # 502 "no live upstreams". Pin the v4 address.
35 proxyPass = "http://${self.inputs.kartei.hosts.yellow.nets.retiolum.ip4.addr}:8096";
36 proxyWebsockets = true;
37 recommendedProxySettings = true;
38 };
39 };
40 services.nginx.virtualHosts."flex.lassul.us" = {
41 forceSSL = true;
42 enableACME = true;
43 locations."/" = {
44 proxyPass = "http://radar.r:7878";
45 proxyWebsockets = true;
46 recommendedProxySettings = true;
47 extraConfig = ''
48 auth_basic "Restricted Content";
49 auth_basic_user_file ${pkgs.writeText "flix-user-pass" ''
50 krebs:$apr1$1Fwt/4T0$YwcUn3OBmtmsGiEPlYWyq0
51 ''};
52 '';
53 };
54 };
55 services.nginx.virtualHosts."flux.lassul.us" = {
56 forceSSL = true;
57 enableACME = true;
58 locations."/" = {
59 proxyPass = "http://sonar.r:8989";
60 proxyWebsockets = true;
61 recommendedProxySettings = true;
62 extraConfig = ''
63 auth_basic "Restricted Content";
64 auth_basic_user_file ${pkgs.writeText "flix-user-pass" ''
65 krebs:$apr1$1Fwt/4T0$YwcUn3OBmtmsGiEPlYWyq0
66 ''};
67 '';
68 };
69 };
70 services.nginx.virtualHosts."flax.lassul.us" = {
71 forceSSL = true;
72 enableACME = true;
73 locations."/" = {
74 proxyPass = "http://yellow.r";
75 proxyWebsockets = true;
76 recommendedProxySettings = true;
77 extraConfig = ''
78 auth_basic "Restricted Content";
79 auth_basic_user_file ${pkgs.writeText "flix-user-pass" ''
80 krebs:$apr1$1Fwt/4T0$YwcUn3OBmtmsGiEPlYWyq0
81 ''};
82 '';
83 };
84 };
85 services.nginx.virtualHosts."flox.lassul.us" = {
86 forceSSL = true;
87 enableACME = true;
88 locations."/" = {
89 proxyPass = "http://yellow.r:5055";
90 proxyWebsockets = true;
91 recommendedProxySettings = true;
92 };
93 };
94}