nginx: add .xyz -> .com redirect
This commit is contained in:
		
							parent
							
								
									418a142f15
								
							
						
					
					
						commit
						52118425ad
					
				
					 1 changed files with 14 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1,10 +1,23 @@
 | 
			
		|||
{ config, pkgs, inputs, ... }: {
 | 
			
		||||
{ config, pkgs, lib, ... }: {
 | 
			
		||||
  services.nginx = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    recommendedProxySettings = 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 = {
 | 
			
		||||
    acceptTerms = true;
 | 
			
		||||
    defaults.email = "lelgenio@disroot.org";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue