You've already forked nginx-proxy-manager
							
							
				mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-10-30 18:05:34 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			70 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package schema
 | |
| 
 | |
| import "fmt"
 | |
| 
 | |
| // UpdateUpstream is the schema for incoming data validation
 | |
| func UpdateUpstream() string {
 | |
| 	return fmt.Sprintf(`
 | |
| 	{
 | |
| 		"type": "object",
 | |
| 		"additionalProperties": false,
 | |
| 		"minProperties": 1,
 | |
| 		"properties": {
 | |
| 			"name": %s,
 | |
| 			"nginx_template_id": {
 | |
| 				"type": "integer",
 | |
| 				"minimum": 1
 | |
| 			},
 | |
| 			"advanced_config": %s,
 | |
| 			"ip_hash": {
 | |
| 				"type": "boolean"
 | |
| 			},
 | |
| 			"ntlm": {
 | |
| 				"type": "boolean"
 | |
| 			},
 | |
| 			"keepalive": {
 | |
| 				"type": "integer"
 | |
| 			},
 | |
| 			"keepalive_requests": {
 | |
| 				"type": "integer"
 | |
| 			},
 | |
| 			"keepalive_time": {
 | |
| 				"type": "string"
 | |
| 			},
 | |
| 			"keepalive_timeout": {
 | |
| 				"type": "string"
 | |
| 			},
 | |
| 			"servers": {
 | |
| 				"type": "array",
 | |
| 				"minItems": 1,
 | |
| 				"items": {
 | |
| 					"type": "object",
 | |
| 					"additionalProperties": false,
 | |
| 					"required": [
 | |
| 						"server"
 | |
| 					],
 | |
| 					"properties": {
 | |
| 						"server": %s,
 | |
| 						"weight": {
 | |
| 							"type": "integer"
 | |
| 						},
 | |
| 						"max_conns": {
 | |
| 							"type": "integer"
 | |
| 						},
 | |
| 						"max_fails": {
 | |
| 							"type": "integer"
 | |
| 						},
 | |
| 						"fail_timeout": {
 | |
| 							"type": "integer"
 | |
| 						},
 | |
| 						"backup": {
 | |
| 							"type": "boolean"
 | |
| 						}
 | |
| 					}
 | |
| 				}
 | |
| 			}
 | |
| 		}
 | |
| 	}
 | |
| `, stringMinMax(1, 100), stringMinMax(0, 1024), stringMinMax(2, 255))
 | |
| }
 |