mail.idimitrov.dev/mailserver/nginx/default.nix

66 lines
1.6 KiB
Nix
Raw Normal View History

2024-04-05 16:54:34 +02:00
{ config, pkgs, ... }:
2024-02-01 16:51:04 +01:00
let
webshiteConfig = ''
add_header 'Referrer-Policy' 'origin-when-cross-origin';
add_header X-Content-Type-Options nosniff;
add_header Onion-Location http://sxfx23zafag4lixkb4s6zwih7ga5jnzfgtgykcerd354bvb6u7alnkid.onion;
'';
2024-04-05 16:54:34 +02:00
restrictToVpn = ''
allow 10.0.0.2/32;
allow fdc9:281f:04d7:9ee9::2/128;
allow 10.0.0.3/32;
deny all;
'';
2024-02-01 16:51:04 +01:00
in
2023-11-26 12:47:58 +01:00
{
services = {
nginx = {
enable = true;
2023-11-27 14:02:30 +01:00
recommendedGzipSettings = true;
recommendedOptimisation = true;
2023-11-26 12:47:58 +01:00
recommendedProxySettings = true;
recommendedTlsSettings = true;
2023-11-27 14:02:30 +01:00
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
2023-11-28 15:45:47 +01:00
virtualHosts = {
"idimitrov.dev" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3000";
};
2024-02-01 16:51:04 +01:00
extraConfig = webshiteConfig;
2023-11-28 15:45:47 +01:00
};
"www.idimitrov.dev" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3000";
};
2024-02-01 16:51:04 +01:00
extraConfig = webshiteConfig;
2023-11-26 12:47:58 +01:00
};
2024-04-05 16:54:34 +02:00
"${config.mailserver.fqdn}" = {
extraConfig = restrictToVpn;
};
2023-12-28 09:41:26 +01:00
"src.idimitrov.dev" = {
2023-12-16 10:50:47 +01:00
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3001";
};
};
2024-04-21 23:09:48 +02:00
"pic.idimitrov.dev" = {
enableACME = true;
forceSSL = true;
locations."/" = {
extraConfig = ''
autoindex on;
'';
};
root = "/var/pic";
};
2023-11-26 12:47:58 +01:00
};
};
};
}
2023-12-16 10:50:47 +01:00