1. My Caddy version (V2 beta 14
):
2. How I run Caddy:
I use the systemd service template mentioned in the documentation.
My Caddyfile looks like this:
samvanderkris.xyz, www.samvanderkris.xyz {
reverse_proxy * unix:/run/gunicorn.sock
root /static /home/sam/samvanderkris
header / Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
}
a. System environment:
Ubuntu server 19.10, caddy is running as a systemd service. The reverse proxy is supposed to expose a gunicorn/Django server.
3. The problem I’m having:
I’m trying to migrate my Caddy v1 setup to v2. I used v1 in the past to serve my Django/gunicorn server. With my current setup, caddy doesn’t give an error until a user tries to visit the website, at which point it returns a HTTP 500 and gives an error in journalctl.
My old Caddyfile (which I’m trying to recreate) looked like this:
samvanderkris.xyz, www.samvanderkris.xyz {
root /home/sam/samvanderkris
proxy / unix:/run/gunicorn.sock {
except /static
}
header / Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
}
4. Error messages and/or full log output:
Feb 21 13:27:12 arcadia caddy[3132]: 2020/02/21 12:27:12.574 ERROR http.log.error making dial info: upstream unix:/run/gunicorn.sock: invalid dial address unix:/run/gunicorn.sock: address run/gunicorn.sock: missing port in address {"request": {"method": "GET", "uri": "/", "proto": "HTTP/2.0", "remote_addr": "86.91.100.131:18666", "host": "samvanderkris.xyz", "headers": {"Cache-Control": ["max-age=0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0"], "Accept-Encoding": ["gzip, deflate, br"], "Upgrade-Insecure-Requests": ["1"], "Cookie": ["csrftoken=KTW5QIlbU5RdE5BsuRiEFUEUICvp7mbP5xG8eBbEz6N4AB2Ww96naf6tI7pU2HM6"], "Te": ["trailers"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"], "Accept-Language": ["en-US,en;q=0.5"], "Dnt": ["1"]}, "tls": {"resumed": false, "version": 772, "ciphersuite": 4865, "proto": "h2", "proto_mutual": true, "server_name": "samvanderkris.xyz"}}}
5. What I already tried:
I’ve looked through the documentation of the reverse_proxy directive, but couldn’t find anything relevant to my problem.