nicks-nix-config/hosts/Alaska/modules/nginx.nix

49 lines
1.1 KiB
Nix
Raw Normal View History

2023-04-05 21:10:58 -07:00
{ config, lib, pkgs, ... }:
{
2023-04-10 20:23:37 -07:00
security.acme = {
acceptTerms = true;
defaults.email = "nicholasyoungsumner@gmail.com";
};
2023-04-05 21:10:58 -07:00
services.nginx = {
enable = true;
2023-04-10 19:33:56 -07:00
commonHttpConfig = ''
real_ip_header CF-Connecting-IP;
add_header 'Referrer-Policy' 'origin-when-cross-origin';
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
'';
2023-04-05 21:10:58 -07:00
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
2023-04-10 19:33:56 -07:00
"jellyfin.nickiel.net" = {
forceSSL = true;
2023-04-10 20:23:37 -07:00
enableACME = true;
2023-04-10 19:33:56 -07:00
locations."/" = {
proxyPass = "http://127.0.0.1:8096/";
proxyWebsockets = true;
#extraConfig = "proxy_pass_header Authorization";
};
2023-04-10 19:33:56 -07:00
};
2023-04-10 20:23:37 -07:00
"files.nickiel.net" = {
forceSSL = true;
enableACME = true;
};
2023-05-06 10:12:27 -07:00
"git.nickiel.net" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://127.0.0.1:3001";
};
2023-05-06 10:28:31 -07:00
2023-04-05 21:10:58 -07:00
};
};
}