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

     1  {
     2  	layer4 {
     3  		0.0.0.0:8765 {
     4  			route {
     5  				proxy {
     6  					health_interval 1s
     7  					health_port 8080
     8  					health_timeout 2s
     9  					fail_duration 5s
    10  					max_fails 10
    11  					unhealthy_connection_count 5
    12  					lb_policy round_robin
    13  					lb_try_duration 5s
    14  					lb_try_interval 15s
    15  					proxy_protocol v2
    16  					upstream 10.0.0.1:8080
    17  					upstream 10.0.0.2:8080 10.0.0.2:8888
    18  				}
    19  			}
    20  		}
    21  		0.0.0.0:9876 {
    22  			route {
    23  				proxy {
    24  					lb_policy random_choose 2
    25  					upstream {
    26  						dial 10.0.0.3:443 10.0.0.33:443
    27  						max_connections 2
    28  						tls
    29  					}
    30  					upstream {
    31  						dial 10.0.0.4:443 10.0.0.44:443
    32  						max_connections 4
    33  						tls_insecure_skip_verify
    34  						tls_renegotiation once
    35  					}
    36  				}
    37  			}
    38  		}
    39  	}
    40  }
    41  ----------
    42  {
    43  	"apps": {
    44  		"layer4": {
    45  			"servers": {
    46  				"srv0": {
    47  					"listen": [
    48  						"0.0.0.0:8765"
    49  					],
    50  					"routes": [
    51  						{
    52  							"handle": [
    53  								{
    54  									"handler": "proxy",
    55  									"health_checks": {
    56  										"active": {
    57  											"interval": 1000000000,
    58  											"port": 8080,
    59  											"timeout": 2000000000
    60  										},
    61  										"passive": {
    62  											"fail_duration": 5000000000,
    63  											"max_fails": 10,
    64  											"unhealthy_connection_count": 5
    65  										}
    66  									},
    67  									"load_balancing": {
    68  										"selection": {
    69  											"policy": "round_robin"
    70  										},
    71  										"try_duration": 5000000000,
    72  										"try_interval": 15000000000
    73  									},
    74  									"proxy_protocol": "v2",
    75  									"upstreams": [
    76  										{
    77  											"dial": [
    78  												"10.0.0.1:8080"
    79  											]
    80  										},
    81  										{
    82  											"dial": [
    83  												"10.0.0.2:8080",
    84  												"10.0.0.2:8888"
    85  											]
    86  										}
    87  									]
    88  								}
    89  							]
    90  						}
    91  					]
    92  				},
    93  				"srv1": {
    94  					"listen": [
    95  						"0.0.0.0:9876"
    96  					],
    97  					"routes": [
    98  						{
    99  							"handle": [
   100  								{
   101  									"handler": "proxy",
   102  									"load_balancing": {
   103  										"selection": {
   104  											"choose": 2,
   105  											"policy": "random_choose"
   106  										}
   107  									},
   108  									"upstreams": [
   109  										{
   110  											"dial": [
   111  												"10.0.0.3:443",
   112  												"10.0.0.33:443"
   113  											],
   114  											"max_connections": 2,
   115  											"tls": {}
   116  										},
   117  										{
   118  											"dial": [
   119  												"10.0.0.4:443",
   120  												"10.0.0.44:443"
   121  											],
   122  											"max_connections": 4,
   123  											"tls": {
   124  												"insecure_skip_verify": true,
   125  												"renegotiation": "once"
   126  											}
   127  										}
   128  									]
   129  								}
   130  							]
   131  						}
   132  					]
   133  				}
   134  			}
   135  		}
   136  	}
   137  }