nixos/modules/nginx-reverse-proxy.nix

30 lines
823 B
Nix
Raw Normal View History

2021-06-10 20:56:40 +02:00
{ pkgs, ... }:
{
security.acme.email = "malte.tammena@pm.me";
security.acme.acceptTerms = true;
2021-06-10 21:40:10 +02:00
networking.firewall.allowedTCPPorts = [ 443 80 ];
2021-06-10 20:56:40 +02:00
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;";
# };
# };
};
}