Adapting your config from your original post (and removing import cert-1
because you didn’t include it in what you posted – please don’t omit config next time you ask questions!):
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"match": [
{
"host": [
"www.domain.com"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "vars",
"root": "/var/www/www"
},
{
"encodings": {
"gzip": {},
"zstd": {}
},
"handler": "encode"
},
{
"handler": "push"
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"headers": {
"request": {
"add": {
"X-Du-Ip": [
"{http.request.header.X-Forwarded-For}"
],
"X-Du-Token": [
"***********"
]
}
}
},
"upstreams": [
{
"dial": "differ.domain.com:80"
}
]
}
],
"match": [
{
"path": [
"/route/*"
]
}
]
},
{
"handle": [
{
"handler": "static_response",
"headers": {
"Location": [
"{http.request.uri.path}/"
]
},
"status_code": 308
}
],
"match": [
{
"file": {
"try_files": [
"{http.request.uri.path}/index.php"
]
},
"not": [
{
"path": [
"*/"
]
}
]
}
]
},
{
"handle": [
{
"handler": "rewrite",
"uri": "{http.matchers.file.relative}"
}
],
"match": [
{
"file": {
"split_path": [
".php"
],
"try_files": [
"{http.request.uri.path}",
"{http.request.uri.path}/index.php",
"index.php"
]
}
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"transport": {
"protocol": "fastcgi",
"split_path": [
".php"
]
},
"upstreams": [
{
"dial": "unix//run/php/php7.4-fpm.sock"
}
]
}
],
"match": [
{
"path": [
"*.php"
]
}
]
},
{
"handle": [
{
"handler": "file_server",
"hide": [
".\\Caddyfile"
]
}
]
}
]
}
],
"terminal": true
}
]
}
}
}
}
}
And adapting your config you said works:
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"match": [
{
"host": [
"www.domain.com"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "vars",
"root": "/var/www/www"
},
{
"encodings": {
"gzip": {}
},
"handler": "encode"
},
{
"handler": "push"
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"headers": {
"request": {
"set": {
"X-Du-Ip": [
"{http.request.remote}"
],
"X-Du-Token": [
"****************"
]
}
}
},
"upstreams": [
{
"dial": "differ.domain.com:80"
}
]
}
],
"match": [
{
"path": [
"/route/*"
]
}
]
},
{
"handle": [
{
"handler": "static_response",
"headers": {
"Location": [
"{http.request.uri.path}/"
]
},
"status_code": 308
}
],
"match": [
{
"file": {
"try_files": [
"{http.request.uri.path}/index.php"
]
},
"not": [
{
"path": [
"*/"
]
}
]
}
]
},
{
"handle": [
{
"handler": "rewrite",
"uri": "{http.matchers.file.relative}"
}
],
"match": [
{
"file": {
"split_path": [
".php"
],
"try_files": [
"{http.request.uri.path}",
"{http.request.uri.path}/index.php",
"index.php"
]
}
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"transport": {
"protocol": "fastcgi",
"split_path": [
".php"
]
},
"upstreams": [
{
"dial": "unix//run/php/php7.4-fpm.sock"
}
]
}
],
"match": [
{
"path": [
"*.php"
]
}
]
},
{
"handle": [
{
"handler": "file_server",
"hide": [
".\\Caddyfile"
]
}
]
}
]
}
],
"terminal": true
}
]
}
}
}
}
}
The only differences I see in the JSON output are that you removed zstd
, and you changed the proxy headers. Nothing else is different. So I don’t trust that statement.