some nginx log and access changes

This commit is contained in:
Reid 2024-03-19 22:47:33 -07:00
parent 913572b770
commit 68737c75e3

View file

@ -5,7 +5,7 @@ let
cfg = config.modules.services.nginx-config; cfg = config.modules.services.nginx-config;
in { in {
options.modules.services.nginx-config = { options.modules.services.nginx-config = {
enable = mkEnableOption "enable nginx, a high performance web server along with default configurations"; enable = mkEnableOption "enable and configure nginx. you know what nginx is.";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
@ -28,6 +28,7 @@ in {
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults.email = "reidlab325@gmail.com"; defaults.email = "reidlab325@gmail.com";
# uncomment me for staging!
# defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory"; # defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
}; };
@ -40,8 +41,6 @@ in {
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedProxySettings = true; recommendedProxySettings = true;
logError = "stderr warn";
# TODO: clean this up oh my god like everything here :sob: im vomiting shaking and crying looking at this. # TODO: clean this up oh my god like everything here :sob: im vomiting shaking and crying looking at this.
commonHttpConfig = let commonHttpConfig = let
# lua # lua
@ -98,6 +97,9 @@ in {
${realIpsFromList cfipv6} ${realIpsFromList cfipv6}
real_ip_header CF-Connecting-IP; real_ip_header CF-Connecting-IP;
''; '';
# this prevents invalid domains and direct ip access from being used
virtualHosts."_".locations."/".return = "444";
}; };
networking.firewall.allowedTCPPorts = [ 443 80 ]; networking.firewall.allowedTCPPorts = [ 443 80 ];