Just do the nginx proxy_protocol listen in extraConfig and use stable packages
This commit is contained in:
		
					parent
					
						
							
								7283b50b39
							
						
					
				
			
			
				commit
				
					
						1c268bbea6
					
				
			
		
					 4 changed files with 23 additions and 43 deletions
				
			
		| 
						 | 
				
			
			@ -24,7 +24,6 @@ let
 | 
			
		|||
in
 | 
			
		||||
  generateDefaults {
 | 
			
		||||
    hydra = {
 | 
			
		||||
      hostNixpkgs = nixpkgs-unstable;
 | 
			
		||||
      site = "vs";
 | 
			
		||||
    };
 | 
			
		||||
    iperf = {
 | 
			
		||||
| 
						 | 
				
			
			@ -47,11 +46,9 @@ in
 | 
			
		|||
      site = "vs";
 | 
			
		||||
    };
 | 
			
		||||
    nextcloud = {
 | 
			
		||||
      hostNixpkgs = nixpkgs-unstable;
 | 
			
		||||
      site = "vs";
 | 
			
		||||
    };
 | 
			
		||||
    nitter = {
 | 
			
		||||
      hostNixpkgs = nixpkgs-unstable;
 | 
			
		||||
      site = "vs";
 | 
			
		||||
    };
 | 
			
		||||
    coturn = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,41 +3,40 @@
 | 
			
		|||
  services.nginx = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    virtualHosts = {
 | 
			
		||||
 | 
			
		||||
      "hydra.nekover.se" = {
 | 
			
		||||
        forceSSL = true;
 | 
			
		||||
        enableACME = true;
 | 
			
		||||
        listen = [{
 | 
			
		||||
          addr = "127.0.0.1";
 | 
			
		||||
          port = 1234;
 | 
			
		||||
        }{
 | 
			
		||||
          addr = "0.0.0.0";
 | 
			
		||||
          port = 8443;
 | 
			
		||||
          ssl = true;
 | 
			
		||||
          proxyProtocol = true;
 | 
			
		||||
          port = 80;
 | 
			
		||||
        }];
 | 
			
		||||
        locations."/" = {
 | 
			
		||||
          proxyPass = "http://localhost:3001";
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
        extraConfig = ''
 | 
			
		||||
          listen 0.0.0.0:8443 http2 ssl proxy_protocol;
 | 
			
		||||
 | 
			
		||||
          set_real_ip_from 10.202.41.100;
 | 
			
		||||
          real_ip_header proxy_protocol;
 | 
			
		||||
        '';
 | 
			
		||||
      };
 | 
			
		||||
      "nix-cache.nekover.se" = {
 | 
			
		||||
        forceSSL = true;
 | 
			
		||||
        enableACME = true;
 | 
			
		||||
        listen = [{
 | 
			
		||||
          addr = "127.0.0.1";
 | 
			
		||||
          port = 1234;
 | 
			
		||||
        }{
 | 
			
		||||
        listen = [        {
 | 
			
		||||
          addr = "0.0.0.0";
 | 
			
		||||
          port = 8443;
 | 
			
		||||
          ssl = true;
 | 
			
		||||
          proxyProtocol = true;
 | 
			
		||||
          port = 80;
 | 
			
		||||
        }];
 | 
			
		||||
        locations."/" = {
 | 
			
		||||
          proxyPass = "http://localhost:5005";
 | 
			
		||||
        };
 | 
			
		||||
        extraConfig = ''
 | 
			
		||||
          listen 0.0.0.0:8443 http2 ssl proxy_protocol;
 | 
			
		||||
 | 
			
		||||
          set_real_ip_from 10.202.41.100;
 | 
			
		||||
          real_ip_header proxy_protocol;
 | 
			
		||||
        '';
 | 
			
		||||
      };
 | 
			
		||||
      
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,19 +41,9 @@
 | 
			
		|||
    virtualHosts.${config.services.nextcloud.hostName} = {
 | 
			
		||||
      forceSSL = true;
 | 
			
		||||
      enableACME = true;
 | 
			
		||||
      listen = [
 | 
			
		||||
        { 
 | 
			
		||||
          addr = "localhost";
 | 
			
		||||
          port = 1234;
 | 
			
		||||
        } # workaround for enableACME check
 | 
			
		||||
        {
 | 
			
		||||
          addr = "0.0.0.0";
 | 
			
		||||
          port = 8443;
 | 
			
		||||
          ssl = true;
 | 
			
		||||
          proxyProtocol = true;
 | 
			
		||||
        }
 | 
			
		||||
      ];
 | 
			
		||||
      extraConfig = ''
 | 
			
		||||
        listen 0.0.0.0:8443 http2 ssl proxy_protocol;
 | 
			
		||||
 | 
			
		||||
        set_real_ip_from 10.202.41.100;
 | 
			
		||||
        real_ip_header proxy_protocol;
 | 
			
		||||
      '';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,18 +5,6 @@
 | 
			
		|||
    virtualHosts."birdsite.nekover.se" = {
 | 
			
		||||
      forceSSL = true;
 | 
			
		||||
      enableACME = true;
 | 
			
		||||
      listen = [
 | 
			
		||||
        { 
 | 
			
		||||
          addr = "localhost";
 | 
			
		||||
          port = 1234;
 | 
			
		||||
        } # workaround for enableACME check
 | 
			
		||||
        {
 | 
			
		||||
          addr = "0.0.0.0";
 | 
			
		||||
          port = 8443;
 | 
			
		||||
          ssl = true;
 | 
			
		||||
          proxyProtocol = true;
 | 
			
		||||
        }
 | 
			
		||||
      ];
 | 
			
		||||
      locations."/robots.txt" = {
 | 
			
		||||
        return = "200 \"User-agent: *\\nDisallow: /\\n\"";
 | 
			
		||||
      };
 | 
			
		||||
| 
						 | 
				
			
			@ -24,6 +12,12 @@
 | 
			
		|||
        proxyPass = "http://${config.services.nitter.server.address}:${builtins.toString config.services.nitter.server.port}";
 | 
			
		||||
        proxyWebsockets = true;
 | 
			
		||||
      };
 | 
			
		||||
      extraConfig = ''
 | 
			
		||||
        listen 0.0.0.0:8443 http2 ssl proxy_protocol;
 | 
			
		||||
 | 
			
		||||
        set_real_ip_from 10.202.41.100;
 | 
			
		||||
        real_ip_header proxy_protocol;
 | 
			
		||||
      '';
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue