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

     1  {
     2  	layer4 {
     3  		:80 {
     4  			@a http host localhost
     5  			@b http {
     6  				host example.com
     7  				remote_ip 192.168.0.0/16
     8  			}
     9  			@c http not path /index.html
    10  			route @c {
    11  				proxy localhost:8083
    12  			}
    13  			route @a {
    14  				proxy localhost:8081
    15  			}
    16  			route @b {
    17  				proxy localhost:8082
    18  			}
    19  		}
    20  	}
    21  }
    22  ----------
    23  {
    24  	"apps": {
    25  		"layer4": {
    26  			"servers": {
    27  				"srv0": {
    28  					"listen": [
    29  						":80"
    30  					],
    31  					"routes": [
    32  						{
    33  							"match": [
    34  								{
    35  									"http": [
    36  										{
    37  											"not": [
    38  												{
    39  													"path": [
    40  														"/index.html"
    41  													]
    42  												}
    43  											]
    44  										}
    45  									]
    46  								}
    47  							],
    48  							"handle": [
    49  								{
    50  									"handler": "proxy",
    51  									"upstreams": [
    52  										{
    53  											"dial": [
    54  												"localhost:8083"
    55  											]
    56  										}
    57  									]
    58  								}
    59  							]
    60  						},
    61  						{
    62  							"match": [
    63  								{
    64  									"http": [
    65  										{
    66  											"host": [
    67  												"localhost"
    68  											]
    69  										}
    70  									]
    71  								}
    72  							],
    73  							"handle": [
    74  								{
    75  									"handler": "proxy",
    76  									"upstreams": [
    77  										{
    78  											"dial": [
    79  												"localhost:8081"
    80  											]
    81  										}
    82  									]
    83  								}
    84  							]
    85  						},
    86  						{
    87  							"match": [
    88  								{
    89  									"http": [
    90  										{
    91  											"host": [
    92  												"example.com"
    93  											],
    94  											"remote_ip": {
    95  												"ranges": [
    96  													"192.168.0.0/16"
    97  												]
    98  											}
    99  										}
   100  									]
   101  								}
   102  							],
   103  							"handle": [
   104  								{
   105  									"handler": "proxy",
   106  									"upstreams": [
   107  										{
   108  											"dial": [
   109  												"localhost:8082"
   110  											]
   111  										}
   112  									]
   113  								}
   114  							]
   115  						}
   116  					]
   117  				}
   118  			}
   119  		}
   120  	}
   121  }