{ services.nginx.enable = true; services.nginx.enableReload = true; users.users.nginx.extraGroups = ["acme"]; services.nginx.virtualHosts."m4siri.com" = { http2 = true; addSSL = true; useACMEHost = "m4siri.com"; locations."/molly" = { proxyPass = "http://localhost:8091/"; extraConfig = '' proxy_set_header Host $host; proxy_set_header X-Original-URL $request_uri; ''; }; }; services.nginx.virtualHosts."mail.m4siri.com" = { http2 = true; addSSL = true; useACMEHost = "mail.m4siri.com"; locations."/" = { proxyPass = "http://localhost:8080"; proxyWebsockets = true; }; locations."/.well-known/jmap" = { proxyPass = "https://localhost:1443"; }; locations."/jmap/session" = { proxyPass = "https://localhost:1443"; }; locations."/jmap" = { proxyPass = "http://localhost:8080"; proxyWebsockets = true; }; }; services.nginx.virtualHosts."ntfy.m4siri.com" = { http2 = true; addSSL = true; useACMEHost = "ntfy.m4siri.com"; locations."/" = { proxyPass = "http://localhost:8090"; proxyWebsockets = true; extraConfig = '' proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; ''; }; }; services.nginx.virtualHosts."shashwothapa.com.np" = { http2 = true; addSSL = true; useACMEHost = "shashwothapa.com.np"; locations."/" = { return = "418"; }; }; services.nginx.virtualHosts."mail.shashwothapa.com.np" = { http2 = true; addSSL = true; useACMEHost = "mail.shashwothapa.com.np"; locations."/" = { proxyPass = "http://localhost:8080"; proxyWebsockets = true; }; }; }