1
Fork 0
mirror of https://github.com/RGBCube/Site synced 2025-08-01 13:37:49 +00:00

Maybe fix ACME????????

This commit is contained in:
RGBCube 2024-01-11 18:31:19 +03:00
parent f149577e62
commit 3d2c3e760d
No known key found for this signature in database

View file

@ -147,6 +147,11 @@
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
security.acme.certs.${cfg.url} = {
domain = "*.${cfg.url}";
group = "nginx";
};
services.nginx = mkIf cfg.configureNginx { services.nginx = mkIf cfg.configureNginx {
enable = true; enable = true;
@ -156,15 +161,15 @@
recommendedTlsSettings = mkDefault true; recommendedTlsSettings = mkDefault true;
virtualHosts.${cfg.url} = { virtualHosts.${cfg.url} = {
enableACME = true; forceSSL = true;
forceSSL = true; useACMEHost = cfg.url;
locations."/".proxyPass = "http://localhost:${toString cfg.port}"; locations."/".proxyPass = "http://localhost:${toString cfg.port}";
}; };
virtualHosts."www.${cfg.url}" = { virtualHosts."www.${cfg.url}" = {
enableACME = true; forceSSL = true;
forceSSL = true; useACMEHost = cfg.url;
locations."/".extraConfig = '' locations."/".extraConfig = ''
return 301 https://${cfg.url}$request_uri; return 301 https://${cfg.url}$request_uri;
@ -173,7 +178,7 @@
virtualHosts._ = { virtualHosts._ = {
forceSSL = true; forceSSL = true;
useACMEHost = "*.${cfg.url}"; useACMEHost = cfg.url;
locations."/".extraConfig = '' locations."/".extraConfig = ''
proxy_pass http://localhost:${toString cfg.port}/404; proxy_pass http://localhost:${toString cfg.port}/404;
@ -185,8 +190,6 @@
}; };
}; };
security.acme.certs."*.${cfg.url}" = {};
systemd.services.site = { systemd.services.site = {
description = "RGBCube's Homepage"; description = "RGBCube's Homepage";
requires = [ "network.target" ]; requires = [ "network.target" ];