infrastructure/hosts/kinda.sus.lol/services/nginx.nix

116 lines
4.1 KiB
Nix
Raw Normal View History

2023-04-12 12:47:22 +00:00
{ config, ... }:
{
networking.firewall.allowedTCPPorts = [ 80 443 ];
users.users.nginx.extraGroups = [ config.users.groups.keys.name ];
services.nginx = {
enable = true;
virtualHosts."kinda.sus.lol" = {
serverName = "kinda.sus.lol";
locations = {
"/music" = {
extraConfig = ''
proxy_pass http://127.0.0.1:4533;
proxy_read_timeout 900;
proxy_connect_timeout 900;
proxy_send_timeout 900;
send_timeout 900;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
'';
};
2023-04-12 12:47:22 +00:00
"/admin/sonarr" = {
extraConfig = ''
auth_basic "Show slit";
auth_basic_user_file /run/secrets/services/nginx/admin.htpasswd;
proxy_pass http://127.0.0.1:8989;
proxy_read_timeout 900;
proxy_connect_timeout 900;
proxy_send_timeout 900;
send_timeout 900;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
'';
};
"/admin/radarr" = {
extraConfig = ''
auth_basic "Show slit";
auth_basic_user_file /run/secrets/services/nginx/admin.htpasswd;
proxy_pass http://127.0.0.1:7878;
proxy_read_timeout 900;
proxy_connect_timeout 900;
proxy_send_timeout 900;
send_timeout 900;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
'';
};
"/admin/lidarr" = {
extraConfig = ''
auth_basic "Show slit";
auth_basic_user_file /run/secrets/services/nginx/admin.htpasswd;
proxy_pass http://127.0.0.1:8686;
proxy_read_timeout 900;
proxy_connect_timeout 900;
proxy_send_timeout 900;
send_timeout 900;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
'';
};
"/admin/deemix" = {
extraConfig = ''
auth_basic "Show slit";
auth_basic_user_file /run/secrets/services/nginx/admin.htpasswd;
proxy_pass http://127.0.0.1:6595;
proxy_read_timeout 900;
proxy_connect_timeout 900;
proxy_send_timeout 900;
send_timeout 900;
2023-04-12 12:47:22 +00:00
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
'';
};
"/admin/prowlarr" = {
extraConfig = ''
auth_basic "Show slit";
auth_basic_user_file /run/secrets/services/nginx/admin.htpasswd;
proxy_pass http://127.0.0.1:9696;
proxy_read_timeout 900;
proxy_connect_timeout 900;
proxy_send_timeout 900;
send_timeout 900;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
'';
};
};
};
};
}