mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-25 15:52:45 -04:00 
			
		
		
		
	* caddyfile: Populate regexp matcher names by default * Some lint cleanup that my VSCode complained about * Pass down matcher name through expression matcher * Compat with #6113: fix adapt test, set both styles in replacer
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| localhost:80
 | |
| 
 | |
| respond * "{header.content-type} {labels.0} {query.p} {path.0} {re.name.0}"
 | |
| 
 | |
| @match path_regexp ^/foo(.*)$
 | |
| respond @match "{re.1}"
 | |
| ----------
 | |
| {
 | |
| 	"apps": {
 | |
| 		"http": {
 | |
| 			"servers": {
 | |
| 				"srv0": {
 | |
| 					"listen": [
 | |
| 						":80"
 | |
| 					],
 | |
| 					"routes": [
 | |
| 						{
 | |
| 							"match": [
 | |
| 								{
 | |
| 									"host": [
 | |
| 										"localhost"
 | |
| 									]
 | |
| 								}
 | |
| 							],
 | |
| 							"handle": [
 | |
| 								{
 | |
| 									"handler": "subroute",
 | |
| 									"routes": [
 | |
| 										{
 | |
| 											"handle": [
 | |
| 												{
 | |
| 													"body": "{http.regexp.1}",
 | |
| 													"handler": "static_response"
 | |
| 												}
 | |
| 											],
 | |
| 											"match": [
 | |
| 												{
 | |
| 													"path_regexp": {
 | |
| 														"name": "match",
 | |
| 														"pattern": "^/foo(.*)$"
 | |
| 													}
 | |
| 												}
 | |
| 											]
 | |
| 										},
 | |
| 										{
 | |
| 											"handle": [
 | |
| 												{
 | |
| 													"body": "{http.request.header.content-type} {http.request.host.labels.0} {http.request.uri.query.p} {http.request.uri.path.0} {http.regexp.name.0}",
 | |
| 													"handler": "static_response"
 | |
| 												}
 | |
| 											]
 | |
| 										}
 | |
| 									]
 | |
| 								}
 | |
| 							],
 | |
| 							"terminal": true
 | |
| 						}
 | |
| 					]
 | |
| 				}
 | |
| 			}
 | |
| 		}
 | |
| 	}
 | |
| } |