nginx: add .xyz -> .com redirect

This commit is contained in:
Leonardo Eugênio 2024-05-14 16:56:09 -03:00
parent 2516836026
commit c40cbf74f3

View file

@ -1,10 +1,23 @@
{ config, pkgs, inputs, ... }: { { config, pkgs, lib, ... }: {
services.nginx = { services.nginx = {
enable = true; enable = true;
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
}; };
# Redirect *lelgenio.xyz -> *lelgenio.com
services.nginx.virtualHosts = lib.mapAttrs'
(key: value: lib.nameValuePair "${key}lelgenio.xyz" value)
(
lib.genAttrs [ "" "social." "blog." "cloud." "mail." ] (name: {
enableACME = true;
forceSSL = true;
locations."/".return = "301 $scheme://${name}lelgenio.com$request_uri";
})
);
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults.email = "lelgenio@disroot.org"; defaults.email = "lelgenio@disroot.org";