nixos-configs/nixosConfigurations/vinzenz-lpt2/nginx.nix

67 lines
1.4 KiB
Nix
Raw Normal View History

2025-09-13 15:10:42 +02:00
{ pkgs, ... }:
2025-09-06 20:28:38 +02:00
let
blog-domain-socket = "/run/nginx/blog.sock";
anubis-domain-socket = "/run/anubis/anubis-blog.sock";
in
{
users.groups = {
anubis.members = [ "nginx" ];
nginx.members = [ "anubis" ];
};
services = {
nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
2024-10-26 18:15:50 +02:00
2025-09-06 20:28:38 +02:00
virtualHosts = {
#"vinzenz-lpt2" = {
# locations."/" = {
# proxyPass = "http://127.0.0.1:3000/";
# proxyWebsockets = true;
# };
#
# serverAliases = [ "172.23.42.96" ];
#};
2024-10-26 18:15:50 +02:00
2025-09-06 20:28:38 +02:00
"vinzenz-lpt2" = {
locations."/" = {
proxyPass = "http://unix:" + anubis-domain-socket;
2025-09-06 20:28:38 +02:00
};
2024-10-26 18:15:50 +02:00
};
2025-09-06 20:28:38 +02:00
"vinzenz-lpt2-in-anubis" = {
2025-09-13 15:10:42 +02:00
root = pkgs.zerforschen-plus-content;
2025-09-06 20:28:38 +02:00
listen = [
{
addr = "unix:" + blog-domain-socket;
2025-09-06 20:28:38 +02:00
}
];
};
2024-10-26 18:15:50 +02:00
};
};
2025-09-06 20:28:38 +02:00
#networking.firewall = {
# allowedTCPPorts = [
# 80
# 8001
# 3000
# ];
# allowedUDPPorts = [ 2342 ];
#};
anubis = {
instances.main = {
enable = true;
settings = {
BIND = anubis-domain-socket;
TARGET = "unix://" + blog-domain-socket;
};
};
};
2024-10-26 18:15:50 +02:00
};
}