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-08 22:37:43 +00:00
|
|
|
server {
|
2023-04-08 23:58:02 +00:00
|
|
|
listen 0.0.0.0:${builtins.toString(secret.nginx.upstream.home.port)} proxy_protocol;
|
2023-04-08 23:57:25 +00:00
|
|
|
proxy_connect_timeout 2s;
|
|
|
|
proxy_timeout 3s;
|
2023-04-08 23:32:04 +00:00
|
|
|
proxy_pass ${secret.nginx.upstream.home.hostname}:${builtins.toString(secret.nginx.upstream.home.port)};
|
2023-04-08 22:37:43 +00:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
|
|
|
networking.firewall.interfaces."enp1s0".allowedTCPPorts = [ secret.nginx.upstream.home.port ];
|
|
|
|
}
|