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 
			
		
		
		
	
		
			
				
	
	
		
			89 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			89 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package schema
 | |
| 
 | |
| import "fmt"
 | |
| 
 | |
| // CreateHost is the schema for incoming data validation
 | |
| // This schema supports 3 possible types with different data combinations:
 | |
| // - proxy
 | |
| // - redirection
 | |
| // - dead
 | |
| func CreateHost() string {
 | |
| 	return fmt.Sprintf(`
 | |
| 		{
 | |
| 			"oneOf": [
 | |
| 				{
 | |
| 					"type": "object",
 | |
| 					"additionalProperties": false,
 | |
| 					"required": [
 | |
| 						"type",
 | |
| 						"domain_names",
 | |
| 						"nginx_template_id",
 | |
| 						"proxy_scheme"
 | |
| 					],
 | |
| 					"properties": {
 | |
| 						"type": {
 | |
| 							"type": "string",
 | |
| 							"pattern": "^proxy$"
 | |
| 						},
 | |
| 						"nginx_template_id": {
 | |
| 							"type": "integer",
 | |
| 							"minimum": 1
 | |
| 						},
 | |
| 						"listen_interface": %s,
 | |
| 						"domain_names": %s,
 | |
| 						"upstream_id": {
 | |
| 							"type": "integer"
 | |
| 						},
 | |
| 						"proxy_scheme": {
 | |
| 							"type": "string",
 | |
| 							"pattern": "^https?$"
 | |
| 						},
 | |
| 						"proxy_host": {
 | |
| 							"type": "string"
 | |
| 						},
 | |
| 						"proxy_port": {
 | |
| 							"type": "integer"
 | |
| 						},
 | |
| 						"certificate_id": {
 | |
| 							"type": "integer"
 | |
| 						},
 | |
| 						"access_list_id": {
 | |
| 							"type": "integer"
 | |
| 						},
 | |
| 						"ssl_forced": {
 | |
| 							"type": "boolean"
 | |
| 						},
 | |
| 						"caching_enabled": {
 | |
| 							"type": "boolean"
 | |
| 						},
 | |
| 						"block_exploits": {
 | |
| 							"type": "boolean"
 | |
| 						},
 | |
| 						"allow_websocket_upgrade": {
 | |
| 							"type": "boolean"
 | |
| 						},
 | |
| 						"http2_support": {
 | |
| 							"type": "boolean"
 | |
| 						},
 | |
| 						"hsts_enabled": {
 | |
| 							"type": "boolean"
 | |
| 						},
 | |
| 						"hsts_subdomains": {
 | |
| 							"type": "boolean"
 | |
| 						},
 | |
| 						"paths": {
 | |
| 							"type": "string"
 | |
| 						},
 | |
| 						"advanced_config": {
 | |
| 							"type": "string"
 | |
| 						},
 | |
| 						"is_disabled": {
 | |
| 							"type": "boolean"
 | |
| 						}
 | |
| 					}
 | |
| 				}
 | |
| 			]
 | |
| 		}
 | |
| 	`, stringMinMax(0, 255), domainNames())
 | |
| }
 |