github.com/mholt/caddy-l4@v0.0.0-20241104153248-ec8fae209322/integration/caddyfile_adapt/gd_handler_subroute.caddytest (about)

     1  {
     2  	layer4 {
     3  		:443 {
     4  			@tls tls
     5  			route @tls {
     6  				subroute {
     7  					@abc tls sni abc.example.com
     8  					route @abc {
     9  						proxy abc.machine.local:443
    10  					}
    11  					@def tls sni def.example.com
    12  					@ghi tls sni ghi.example.com
    13  					route @def @ghi {
    14  						proxy defghi.machine.local:443
    15  					}
    16  				}
    17  			}
    18  			route {
    19  				echo
    20  			}
    21  		}
    22  	}
    23  }
    24  ----------
    25  {
    26  	"apps": {
    27  		"layer4": {
    28  			"servers": {
    29  				"srv0": {
    30  					"listen": [
    31  						":443"
    32  					],
    33  					"routes": [
    34  						{
    35  							"match": [
    36  								{
    37  									"tls": {}
    38  								}
    39  							],
    40  							"handle": [
    41  								{
    42  									"handler": "subroute",
    43  									"routes": [
    44  										{
    45  											"handle": [
    46  												{
    47  													"handler": "proxy",
    48  													"upstreams": [
    49  														{
    50  															"dial": [
    51  																"abc.machine.local:443"
    52  															]
    53  														}
    54  													]
    55  												}
    56  											],
    57  											"match": [
    58  												{
    59  													"tls": {
    60  														"sni": [
    61  															"abc.example.com"
    62  														]
    63  													}
    64  												}
    65  											]
    66  										},
    67  										{
    68  											"handle": [
    69  												{
    70  													"handler": "proxy",
    71  													"upstreams": [
    72  														{
    73  															"dial": [
    74  																"defghi.machine.local:443"
    75  															]
    76  														}
    77  													]
    78  												}
    79  											],
    80  											"match": [
    81  												{
    82  													"tls": {
    83  														"sni": [
    84  															"def.example.com"
    85  														]
    86  													}
    87  												},
    88  												{
    89  													"tls": {
    90  														"sni": [
    91  															"ghi.example.com"
    92  														]
    93  													}
    94  												}
    95  											]
    96  										}
    97  									]
    98  								}
    99  							]
   100  						},
   101  						{
   102  							"handle": [
   103  								{
   104  									"handler": "echo"
   105  								}
   106  							]
   107  						}
   108  					]
   109  				}
   110  			}
   111  		}
   112  	}
   113  }