nix-infra/config/hosts/searx/nginx.nix

30 lines
692 B
Nix
Raw Permalink Normal View History

2023-10-16 11:22:48 +02:00
{ config, ... }:
{
services.nginx = {
enable = true;
virtualHosts."searx.nekover.se" = {
forceSSL = true;
enableACME = true;
listen = [
{
addr = "0.0.0.0";
port = 80;
}
{
addr = "0.0.0.0";
port = 8443;
ssl = true;
extraParameters = [ "proxy_protocol" ];
}
];
locations."/" = {
proxyPass = "http://${config.services.searx.settings.server.bind_address}:${builtins.toString config.services.searx.settings.server.port}";
};
extraConfig = ''
set_real_ip_from 10.202.41.100;
real_ip_header proxy_protocol;
'';
};
};
}