nixos/machines/homelab/nginx.nix
2026-09-25 07:33:58 +02:00

30 lines
804 B
Nix

{
security.acme.acceptTerms = true;
services.nginx.enable = true;
services.nginx.virtualHosts = {
"zospace.freeboxos.fr" = {
forceSSL = true;
enableACME = true;
locations."/".root = "/var/www/zospace.freeboxos.fr/";
locations."/forgejo/" = {
extraConfig = ''
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
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;
client_max_body_size 512M;
proxy_pass http://localhost:8888/;
'';
};
};
};
networking.firewall.allowedTCPPorts = [
80
443
];
}