1. The problem I’m having:
The following JSON configuration is how to configure Caddyfile.
"tls_connection_policies": [{
"match": {
"sni": ["z1.xx.yy"]
},
"protocol_max": "tls1.2",
"cipher_suites": ["TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"]
},
{
"match": {
"sni": ["h3.xx.yy","z2.xx.yy"]
},
"cipher_suites": ["TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"],
"curves": ["x25519","secp521r1","secp384r1","secp256r1"],
"alpn": ["h3","h2","http/1.1"]
}],
2. Error messages and/or full log output:
None.
3. Caddy version:
Caddy v2.8.4
4. How I installed and ran Caddy:
Not relevant.
a. System environment:
Not relevant.
b. Command:
None.
c. Service/unit/compose file:
Not relevant.
d. My complete Caddy config:
{
"admin": {
"disabled": true,
"config": {
"persist": false
}
},
"logging": {
"logs": {
"default": {
"writer": {
"output": "file",
"filename": "/var/log/caddy/error.log"
},
"encoder": {
"format": "console"
},
"level": "ERROR",
"exclude": ["http.log.access.log0"]
},
"log0": {
"writer": {
"output": "file",
"filename": "/var/log/caddy/access.log"
},
"encoder": {
"format": "console"
},
"include": ["http.log.access.log0"]
}
}
},
"apps": {
"http": {
"servers": {
"srvh3": {
"listen": [":443"],
"routes": [{
"match": [{
"path": ["/SeuW56Es"]
}],
"handle": [{
"handler": "reverse_proxy",
"transport": {
"protocol": "http",
"versions": ["h2c","2"]
},
"upstreams": [{
"dial": "127.0.0.1:2005"
}]
}]
},
{
"handle": [{
"handler": "forward_proxy",
"auth_credentials": ["ZFhObGNqcHdZWE56"],
"hide_ip": true,
"hide_via": true,
"probe_resistance": {}
}]
},
{
"handle": [{
"handler": "headers",
"response": {
"set": {
"Strict-Transport-Security": ["max-age=31536000; includeSubDomains; preload"]
}
}
},
{
"handler": "file_server",
"root": "/var/www/html"
}]
}],
"tls_connection_policies": [{
"match": {
"sni": ["z1.xx.yy"]
},
"protocol_max": "tls1.2",
"cipher_suites": ["TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"]
},
{
"match": {
"sni": ["h3.xx.yy","z2.xx.yy"]
},
"cipher_suites": ["TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"],
"curves": ["x25519","secp521r1","secp384r1","secp256r1"],
"alpn": ["h3","h2","http/1.1"]
}],
"logs": {
"default_logger_name": "log0"
},
"protocols": ["h1","h2","h3"]
}
}
},
"tls": {
"certificates": {
"automate": ["h3.xx.yy","z1.xx.yy","z2.xx.yy"]
},
"automation": {
"policies": [{
"issuers": [{
"module": "acme",
"email": "your@email.com"
},
{
"module": "acme",
"ca": "https://acme.zerossl.com/v2/DV90",
"email": "your@email.com"
}]
}]
}
}
}
}
5. Links to relevant resources:
None.