mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	* Allow specifying multiple `auto_https` options * Implement `auto_https prefer_wildcard` option * Adapt tests, add mock DNS module for config testing * Rebase fix
		
			
				
	
	
		
			157 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			157 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
*.example.com {
 | 
						|
	tls foo@example.com {
 | 
						|
		dns mock
 | 
						|
	}
 | 
						|
 | 
						|
	@foo host foo.example.com
 | 
						|
	handle @foo {
 | 
						|
		respond "Foo!"
 | 
						|
	}
 | 
						|
 | 
						|
	@bar host bar.example.com
 | 
						|
	handle @bar {
 | 
						|
		respond "Bar!"
 | 
						|
	}
 | 
						|
 | 
						|
	# Fallback for otherwise unhandled domains
 | 
						|
	handle {
 | 
						|
		abort
 | 
						|
	}
 | 
						|
}
 | 
						|
----------
 | 
						|
{
 | 
						|
	"apps": {
 | 
						|
		"http": {
 | 
						|
			"servers": {
 | 
						|
				"srv0": {
 | 
						|
					"listen": [
 | 
						|
						":443"
 | 
						|
					],
 | 
						|
					"routes": [
 | 
						|
						{
 | 
						|
							"match": [
 | 
						|
								{
 | 
						|
									"host": [
 | 
						|
										"*.example.com"
 | 
						|
									]
 | 
						|
								}
 | 
						|
							],
 | 
						|
							"handle": [
 | 
						|
								{
 | 
						|
									"handler": "subroute",
 | 
						|
									"routes": [
 | 
						|
										{
 | 
						|
											"group": "group3",
 | 
						|
											"handle": [
 | 
						|
												{
 | 
						|
													"handler": "subroute",
 | 
						|
													"routes": [
 | 
						|
														{
 | 
						|
															"handle": [
 | 
						|
																{
 | 
						|
																	"body": "Foo!",
 | 
						|
																	"handler": "static_response"
 | 
						|
																}
 | 
						|
															]
 | 
						|
														}
 | 
						|
													]
 | 
						|
												}
 | 
						|
											],
 | 
						|
											"match": [
 | 
						|
												{
 | 
						|
													"host": [
 | 
						|
														"foo.example.com"
 | 
						|
													]
 | 
						|
												}
 | 
						|
											]
 | 
						|
										},
 | 
						|
										{
 | 
						|
											"group": "group3",
 | 
						|
											"handle": [
 | 
						|
												{
 | 
						|
													"handler": "subroute",
 | 
						|
													"routes": [
 | 
						|
														{
 | 
						|
															"handle": [
 | 
						|
																{
 | 
						|
																	"body": "Bar!",
 | 
						|
																	"handler": "static_response"
 | 
						|
																}
 | 
						|
															]
 | 
						|
														}
 | 
						|
													]
 | 
						|
												}
 | 
						|
											],
 | 
						|
											"match": [
 | 
						|
												{
 | 
						|
													"host": [
 | 
						|
														"bar.example.com"
 | 
						|
													]
 | 
						|
												}
 | 
						|
											]
 | 
						|
										},
 | 
						|
										{
 | 
						|
											"group": "group3",
 | 
						|
											"handle": [
 | 
						|
												{
 | 
						|
													"handler": "subroute",
 | 
						|
													"routes": [
 | 
						|
														{
 | 
						|
															"handle": [
 | 
						|
																{
 | 
						|
																	"abort": true,
 | 
						|
																	"handler": "static_response"
 | 
						|
																}
 | 
						|
															]
 | 
						|
														}
 | 
						|
													]
 | 
						|
												}
 | 
						|
											]
 | 
						|
										}
 | 
						|
									]
 | 
						|
								}
 | 
						|
							],
 | 
						|
							"terminal": true
 | 
						|
						}
 | 
						|
					]
 | 
						|
				}
 | 
						|
			}
 | 
						|
		},
 | 
						|
		"tls": {
 | 
						|
			"automation": {
 | 
						|
				"policies": [
 | 
						|
					{
 | 
						|
						"subjects": [
 | 
						|
							"*.example.com"
 | 
						|
						],
 | 
						|
						"issuers": [
 | 
						|
							{
 | 
						|
								"challenges": {
 | 
						|
									"dns": {
 | 
						|
										"provider": {
 | 
						|
											"name": "mock"
 | 
						|
										}
 | 
						|
									}
 | 
						|
								},
 | 
						|
								"email": "foo@example.com",
 | 
						|
								"module": "acme"
 | 
						|
							},
 | 
						|
							{
 | 
						|
								"ca": "https://acme.zerossl.com/v2/DV90",
 | 
						|
								"challenges": {
 | 
						|
									"dns": {
 | 
						|
										"provider": {
 | 
						|
											"name": "mock"
 | 
						|
										}
 | 
						|
									}
 | 
						|
								},
 | 
						|
								"email": "foo@example.com",
 | 
						|
								"module": "acme"
 | 
						|
							}
 | 
						|
						]
 | 
						|
					}
 | 
						|
				]
 | 
						|
			}
 | 
						|
		}
 | 
						|
	}
 | 
						|
} |