diff --git a/nixos/nginx.nix b/nixos/nginx.nix index 40eb8fe..4a7b39c 100644 --- a/nixos/nginx.nix +++ b/nixos/nginx.nix @@ -48,74 +48,74 @@ }; }; - #"philippeterson.com" = { - # enableACME = true; # Enable Let's Encrypt certificate for HTTPS - # forceSSL = false; # Redirect HTTP to HTTPS? - # addSSL = true; + "philippeterson.com" = { + enableACME = true; # Enable Let's Encrypt certificate for HTTPS + forceSSL = false; # Redirect HTTP to HTTPS? + addSSL = true; - # root = "/etc/pullomatic/com_philippeterson"; + root = "/etc/pullomatic/com_philippeterson"; - # locations."~ /.git(/.*)$ " = { - # extraConfig = '' - # deny all; - # return 404; - # ''; - # }; + locations."~ /.git(/.*)$ " = { + extraConfig = '' + deny all; + return 404; + ''; + }; - # locations."/games/atcsim" = { - # extraConfig = '' - # return 301 /games/atcsim/; - # ''; - # }; + locations."/games/atcsim" = { + extraConfig = '' + return 301 /games/atcsim/; + ''; + }; - # locations."~ ^/games/atcsim(/[^/\\s]*)*$" = { - # extraConfig = '' - # index index.html index.htm; - # rewrite ^/games/atcsim/?$ "/index.html" break; - # rewrite ^/games/atcsim(?(/[^/\\s]*)*)$ "$query" break; - # root /etc/pullomatic/atcsim; - # ''; - # }; + locations."~ ^/games/atcsim(/[^/\\s]*)*$" = { + extraConfig = '' + index index.html index.htm; + rewrite ^/games/atcsim/?$ "/index.html" break; + rewrite ^/games/atcsim(?(/[^/\\s]*)*)$ "$query" break; + root /etc/pullomatic/atcsim; + ''; + }; - # locations."/portfolio" = { - # extraConfig = '' - # return 301 /portfolio/; - # ''; - # }; + locations."/portfolio" = { + extraConfig = '' + return 301 /portfolio/; + ''; + }; - # locations."~ ^/portfolio/" = { - # extraConfig = '' - # index index.html index.htm; - # rewrite ^/portfolio/?$ "/index.html" break; - # rewrite ^/portfolio(?(/[^/\\s]*)*)$ "$query" break; - # root /etc/pullomatic/my-portfolio; - # ''; - # }; + locations."~ ^/portfolio/" = { + extraConfig = '' + index index.html index.htm; + rewrite ^/portfolio/?$ "/index.html" break; + rewrite ^/portfolio(?(/[^/\\s]*)*)$ "$query" break; + root /etc/pullomatic/my-portfolio; + ''; + }; - # locations."~ ^/echo(?((/[^/\\s]*)*))$" = { - # extraConfig = '' - # add_header Content-Type text/plain; - # return 200 "$query"; - # ''; - # }; + locations."~ ^/echo(?((/[^/\\s]*)*))$" = { + extraConfig = '' + add_header Content-Type text/plain; + return 200 "$query"; + ''; + }; - # locations."/" = { - # extraConfig = '' - # try_files $uri $uri.php $uri/ =404; - # index index.php index.html index.htm; - # rewrite ^/contact$ /contact.php last; - # rewrite ^/resume$ /resume.php last; - # ''; - # }; + locations."/" = { + extraConfig = '' + try_files $uri $uri.php $uri/ =404; + index index.php index.html index.htm; + rewrite ^/contact$ /contact.php last; + rewrite ^/resume$ /resume.php last; + ''; + }; - # locations."~ \.php$" = { - # extraConfig = '' - # include ${pkgs.nginx}/conf/fastcgi.conf; - # fastcgi_split_path_info ^(.+\.php)(/.+)$; - # fastcgi_pass unix:${config.services.phpfpm.pools.main.socket}; - # ''; - # }; - #}; + locations."~ \.php$" = { + extraConfig = '' + include ${pkgs.nginx}/conf/fastcgi.conf; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:${config.services.phpfpm.pools.main.socket}; + ''; + }; + }; "blog.quineglobal.com" = { enableACME = false; forceSSL = false;