1
0
Fork 0
dotfiles/system/nixos/home-proxy.nix

20 lines
498 B
Nix
Raw Normal View History

2023-04-08 22:37:43 +00:00
{ pkgs, config, secret, ... }:
{
services.nginx.streamConfig = ''
2023-04-08 22:43:37 +00:00
resolver 1.1.1.1 ipv6=off;
2023-04-09 00:11:14 +00:00
upstream home {
2023-04-19 20:38:42 +00:00
server ${secret.nginx.upstream.home.hostname}:${builtins.toString secret.nginx.upstream.home.upstreamPort};
2023-04-09 00:11:14 +00:00
}
2023-04-08 22:37:43 +00:00
server {
2023-04-19 20:38:42 +00:00
listen ${builtins.toString secret.nginx.upstream.home.externalPort};
2023-04-09 00:11:14 +00:00
proxy_protocol on;
proxy_pass home;
2023-04-08 22:37:43 +00:00
}
'';
2023-04-19 20:38:42 +00:00
networking.firewall.interfaces."enp1s0".allowedTCPPorts = [ secret.nginx.upstream.home.externalPort ];
2023-04-08 22:37:43 +00:00
}