pi4: setup web server

This commit is contained in:
NullBite 2024-06-22 01:45:57 -04:00
parent 33707ae4da
commit a90b662ef8
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -10,6 +10,39 @@
group = "secrets";
};
users.users.nginx.extraGroups = [ "acme" ];
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
commonHttpConfig = ''
port_in_redirect off;
'';
virtualHosts = {
"localhost" = {
default = true;
locations."/" = {
return = "302 https://protogen.io$request_uri";
};
};
"protogen.io" = {
useACMEHost = "protogen.io";
forceSSL = true;
locations."/" = {
root = "/srv/http";
extraConfig = ''
autoindex on;
'';
};
};
};
};
security.acme = {
acceptTerms = true;