feat(web-servers): add SSL support
This commit is contained in:
parent
5ba9667f4e
commit
5dfec647b0
1 changed files with 32 additions and 7 deletions
|
@ -9,16 +9,41 @@ in
|
|||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "rafiq@rrv.sh";
|
||||
};
|
||||
}
|
||||
(lib.mkIf cfg.nginx.enable {
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
443
|
||||
80
|
||||
];
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts.${config.system.hostname} = {
|
||||
locations."/" = {
|
||||
return = "200 '<html><body>It works!</body></html'";
|
||||
extraConfig = ''
|
||||
default_type text/html;
|
||||
'';
|
||||
virtualHosts = {
|
||||
"chat.bwfiq.com" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://helios:3080";
|
||||
};
|
||||
};
|
||||
"il.bwfiq.com" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://helios:2283";
|
||||
};
|
||||
};
|
||||
${config.system.hostname} = {
|
||||
locations."/" = {
|
||||
return = "200 '<html><body>It works!</body></html'";
|
||||
extraConfig = ''
|
||||
default_type text/html;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue