nixos-config/config/services/reverse-proxy.nix

32 lines
908 B
Nix
Raw Normal View History

2022-04-25 18:09:22 +00:00
{ config, ... }: {
2022-04-15 08:27:53 +00:00
services.nginx.virtualHosts."hydra.chir.rs" = {
sslCertificate = "/var/lib/acme/chir.rs/cert.pem";
sslCertificateKey = "/var/lib/acme/chir.rs/key.pem";
locations."/" = {
2022-04-25 07:42:50 +00:00
proxyPass = "https://nas.int.chir.rs";
2022-04-15 08:27:53 +00:00
proxyWebsockets = true;
extraConfig = ''
2022-04-15 08:49:48 +00:00
proxy_ssl_server_name on;
'';
2022-04-15 08:27:53 +00:00
};
};
2022-04-25 16:57:59 +00:00
services.nginx.virtualHosts."mastodon.chir.rs" = {
sslCertificate = "/var/lib/acme/chir.rs/cert.pem";
sslCertificateKey = "/var/lib/acme/chir.rs/key.pem";
root = "${config.services.mastodon.package}/public/"; # for spood
locations."/" = {
tryFiles = "$uri @proxy";
};
locations."@proxy" = {
proxyPass = "https://nas.int.chir.rs";
proxyWebsockets = true;
extraConfig = ''
proxy_ssl_server_name on;
'';
};
2022-04-25 20:07:35 +00:00
extraConfig = ''
proxy_set_header "mastodon.chir.rs";
'';
2022-04-25 16:57:59 +00:00
};
2022-04-15 08:27:53 +00:00
}