1. My Caddy version (caddy version
):
v2.0.0-rc.3 h1:z2H/QnaRscip6aZJxwTbghu3zhC88Vo8l/K57WUce4Q=
2. How I run Caddy:
a. System environment:
Fedora 31
b. Command:
caddy run -resume
c. Service/unit/compose file:
None
d. My complete Caddyfile or JSON config:
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "headers",
"response": {
"set": {
"Strict-Transport-Security": [
"max-age=63072000; includeSubDomains; preload"
]
}
}
},
{
"encodings": {
"gzip": {},
"zstd": {}
},
"handler": "encode"
},
{
"handler": "file_server",
"root": "/var/www/mta-sts"
}
],
"match": [
{
"path": [
"/.well-known"
]
}
]
}
]
}
],
"match": [
{
"host": [
"mta-sts.meeple.ninja"
]
}
],
3. The problem I’m having:
I am trying to serve a /.well-known/mta-sts.txt file (See Introducing MTA Strict Transport Security (MTA-STS) | Hardenize Blog for an explanation of MTA-STS) for my various smtp serving domains. I want to serve NOTHING but the mta-sts.txt
file on the url https://mta-sts.meeple.ninja/.well-known/mta-sts.txt. Also, the inability of Caddyfiles to handle logging in caddy v2 frustrated me, so now I am trying to learn it’s JSON config structure. Any assistance would be awesome.
4. Error messages and/or full log output:
{
"level": "info",
"ts": 1587626077.1194618,
"logger": "http.log.access.mta-sts",
"msg": "handled request",
"request": {
"method": "GET",
"uri": "/.well-known/mta-sts.txt",
"proto": "HTTP/2.0",
"remote_addr": "[2604:a880:1:20::121:2001]:48194",
"host": "mta-sts.meeple.ninja",
"headers": {
"User-Agent": [
"curl/7.66.0"
],
"Accept": [
"*/*"
]
},
"tls": {
"resumed": false,
"version": 772,
"ciphersuite": 4865,
"proto": "h2",
"proto_mutual": true,
"server_name": "mta-sts.meeple.ninja"
}
},
"common_log": "2604:a880:1:20::121:2001 - - [23/Apr/2020:00:14:37 -0700] \"GET /.well-known/mta-sts.txt HTTP/2.0\" 0 0",
"latency": 2.2032e-05,
"size": 0,
"status": 0,
"resp_headers": {
"Server": [
"Caddy"
]
}
}