32 lines
		
	
	
	
		
			738 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			738 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ config, ... }:
 | 
						|
{
 | 
						|
  services.nginx = {
 | 
						|
    enable = true;
 | 
						|
    virtualHosts = {
 | 
						|
      ${config.services.grafana.settings.server.domain} = {
 | 
						|
        forceSSL = true;
 | 
						|
        enableACME = true;
 | 
						|
        listen = [
 | 
						|
          {
 | 
						|
            addr = "0.0.0.0";
 | 
						|
            port = 80;
 | 
						|
          }
 | 
						|
          {
 | 
						|
            addr = "0.0.0.0";
 | 
						|
            port = 8443;
 | 
						|
            ssl = true;
 | 
						|
            extraParameters = [ "proxy_protocol" ];
 | 
						|
          }
 | 
						|
        ];
 | 
						|
        locations."/" = {
 | 
						|
          proxyPass = "http://unix:/run/anubis/anubis-nekomesh.sock";
 | 
						|
          proxyWebsockets = true;
 | 
						|
        };
 | 
						|
        extraConfig = ''
 | 
						|
          set_real_ip_from 10.202.41.100;
 | 
						|
          real_ip_header proxy_protocol;
 | 
						|
        '';
 | 
						|
      };
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |