nix-config/hosts/cirrus/nextcloud-proxy.nix

62 lines
1.5 KiB
Nix
Raw Normal View History

2022-06-26 21:05:53 +02:00
{ config, pkgs, ... }: {
security.acme = {
defaults.email = "acme@oxapentane.com";
acceptTerms = true;
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedGzipSettings = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
};
2023-01-24 20:40:41 +01:00
services.nginx.virtualHosts = {
"nc.oxapentane.com" = {
enableACME = true;
forceSSL = true;
extraConfig = ''
2022-06-26 21:05:53 +02:00
client_max_body_size 512M;
2023-01-24 20:40:41 +01:00
'';
locations = {
"/" = {
2022-06-26 21:19:15 +02:00
proxyPass = "http://10.34.45.100:8080";
2022-06-26 21:05:53 +02:00
};
"/well-known/carddav" = {
2022-06-26 21:19:15 +02:00
return = "301 $scheme://$host/remote.php/dav";
2022-06-26 21:05:53 +02:00
};
"/well-known/caldav" = {
2022-06-26 21:19:15 +02:00
return = "301 $scheme://$host/remote.php/dav";
2022-06-26 21:05:53 +02:00
};
2023-01-24 20:40:41 +01:00
};
};
2022-06-26 21:05:53 +02:00
2023-01-24 20:40:41 +01:00
"music.oxapentane.com" = {
enableACME = true;
forceSSL = true;
extraConfig = ''
client_max_body_size 32M;
'';
locations = {
"/" = {
proxyPass = "http://10.34.45.101:4533";
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_buffering off;
'';
};
2022-06-26 21:05:53 +02:00
};
};
2023-01-24 20:40:41 +01:00
};
2022-06-26 21:05:53 +02:00
}