forked from jan-leila/nix-config
		
	feat: refactored reverse proxy to be a normally named module
This commit is contained in:
		
							parent
							
								
									466926b919
								
							
						
					
					
						commit
						4dd285c122
					
				
					 29 changed files with 352 additions and 426 deletions
				
			
		|  | @ -4,31 +4,34 @@ | |||
|   ... | ||||
| }: { | ||||
|   options.services.immich = { | ||||
|     subdomain = lib.mkOption { | ||||
|     domain = lib.mkOption { | ||||
|       type = lib.types.str; | ||||
|       description = "subdomain of base domain that immich will be hosted at"; | ||||
|       default = "immich"; | ||||
|       description = "domain that immich will be hosted at"; | ||||
|       default = "immich.arpa"; | ||||
|     }; | ||||
|     extraDomains = lib.mkOption { | ||||
|       type = lib.types.listOf lib.types.str; | ||||
|       description = "extra domains that should be configured for immich"; | ||||
|       default = []; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = lib.mkIf (config.services.immich.enable && config.host.reverse_proxy.enable) { | ||||
|     host = { | ||||
|       reverse_proxy.subdomains.${config.services.immich.subdomain} = { | ||||
|         target = "http://localhost:${toString config.services.immich.port}"; | ||||
|   config = lib.mkIf (config.services.immich.enable && config.services.reverseProxy.enable) { | ||||
|     services.reverseProxy.services.immich = { | ||||
|       target = "http://localhost:${toString config.services.immich.port}"; | ||||
|       domain = config.services.immich.domain; | ||||
|       extraDomains = config.services.immich.extraDomains; | ||||
| 
 | ||||
|         websockets.enable = true; | ||||
|       settings = { | ||||
|         proxyWebsockets.enable = true; | ||||
|         forwardHeaders.enable = true; | ||||
|         maxBodySize = 50000; | ||||
| 
 | ||||
|         extraConfig = '' | ||||
|           # allow large file uploads | ||||
|           client_max_body_size 50000M; | ||||
| 
 | ||||
|           # set timeout | ||||
|           proxy_read_timeout 600s; | ||||
|           proxy_send_timeout 600s; | ||||
|           send_timeout       600s; | ||||
|           proxy_redirect     off; | ||||
|         ''; | ||||
|         # Custom timeout settings | ||||
|         proxyHeaders = { | ||||
|           enable = true; | ||||
|           timeout = 600; | ||||
|         }; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue