TLS reverse proxy

https://nixos.wiki/wiki/Nginx > TLS reverse proxy

This is a "minimal" example in terms of security, see below for more tips. page

``` services.nginx = { enable = true; recommendedProxySettings = true; recommendedTlsSettings = true; # other Nginx options virtualHosts."example.com" = { enableACME = true; forceSSL = true; locations."/" = { proxyPass = "https://127.0.0.1:12345"; proxyWebsockets = true; # needed if you need to use WebSocket extraConfig = # required when the target is also TLS server with multiple hosts "proxy_ssl_server_name on;" + # required when the server wants to use HTTP Authentication "proxy_pass_header Authorization;" ; }; }; }; ```

# See also Federated Wiki with Nginx – modified server definition, which should possibly be adopted under `extraConfig` in the code snippet above.