1. The problem I’m having:
I’ve been getting started with Caddy only in the last week, so I apologize for my poor proficiency. When I access the site through the reverse proxy, it is slow to load, doesn’t display all images and clicking any link will kick me immediately to the login screen again.
2. Error messages and/or full log output:
Jan 26 03:20:46 caddy caddy[1182]: {"level":"error","ts":1706239246.7281516,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"172.16.120.12:8083","duration":0.136355727,"request":{"remote_ip":"108.162.241.184","remote_port":"30134","client_ip":"108.162.241.184","proto":"HTTP/2.0","method":"GET","host":"library.hellmouth.ca","uri":"/cover/2020/sm?c=1705106337","headers":{"Sec-Fetch-Mode":["no-cors"],"X-Forwarded-For":["108.162.241.184"],"Accept-Language":["en-US,en;q=0.5"],"Cf-Ray":["84b59e890a7f36b5-YYZ"],"X-Forwarded-Host":["library.hellmouth.ca"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Priority":["u=4"],"X-Forwarded-Proto":["https"],"X-Scheme":["https"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0"],"Cf-Connecting-Ip":["MY.IP.ADDRESS"],"Cf-Ipcountry":["CA"],"Accept-Encoding":["gzip"],"Cookie":[],"Cdn-Loop":["cloudflare"],"Sec-Fetch-Dest":["image"],"Accept":["image/avif,image/webp,*/*"],"Sec-Fetch-Site":["same-origin"],"Referer":["https://library.hellmouth.ca/"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","server_name":"library.hellmouth.ca"}},"error":"writing: client disconnected"}
Jan 26 03:21:14 caddy caddy[1182]: {"level":"error","ts":1706239274.6168056,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"172.16.120.12:8083","duration":0.065802308,"request":{"remote_ip":"108.162.241.184","remote_port":"29792","client_ip":"108.162.241.184","proto":"HTTP/2.0","method":"GET","host":"library.hellmouth.ca","uri":"/cover/2036/sm?c=1705106385","headers":{"X-Forwarded-Proto":["https"],"Cf-Ipcountry":["CA"],"Cf-Ray":["84b59e88ea3d36b5-YYZ"],"X-Forwarded-Host":["library.hellmouth.ca"],"X-Scheme":["https"],"Cookie":[],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Sec-Fetch-Site":["same-origin"],"Sec-Fetch-Mode":["no-cors"],"Accept":["image/avif,image/webp,*/*"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0"],"Cdn-Loop":["cloudflare"],"Referer":["https://library.hellmouth.ca/"],"Accept-Language":["en-US,en;q=0.5"],"Priority":["u=4"],"X-Forwarded-For":["108.162.241.184"],"Accept-Encoding":["gzip"],"Sec-Fetch-Dest":["image"],"Cf-Connecting-Ip":["MY.IP.ADDRESS"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","server_name":"library.hellmouth.ca"}},"error":"writing: write tcp 172.16.120.90:443->108.162.241.184:29792: write: connection reset by peer"}
Jan 26 03:21:14 caddy caddy[1182]: {"level":"error","ts":1706239274.617087,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"172.16.120.12:8083","duration":0.390973112,"request":{"remote_ip":"108.162.241.184","remote_port":"30312","client_ip":"108.162.241.184","proto":"HTTP/2.0","method":"GET","host":"library.hellmouth.ca","uri":"/cover/1990/sm?c=1705106230","headers":{"Sec-Fetch-Mode":["no-cors"],"X-Forwarded-Host":["library.hellmouth.ca"],"Cdn-Loop":["cloudflare"],"Accept":["image/avif,image/webp,*/*"],"Sec-Fetch-Dest":["image"],"Cf-Connecting-Ip":["MY.IP.ADDRESS"],"Cf-Ipcountry":["CA"],"Accept-Language":["en-US,en;q=0.5"],"X-Scheme":["https"],"Sec-Fetch-Site":["same-origin"],"Cf-Ray":["84b59e892acb36b5-YYZ"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0"],"Cookie":[],"Accept-Encoding":["gzip"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"X-Forwarded-Proto":["https"],"Priority":["u=4"],"X-Forwarded-For":["108.162.241.184"],"Referer":["https://library.hellmouth.ca/"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","server_name":"library.hellmouth.ca"}},"error":"writing: client disconnected"}
Jan 26 03:21:14 caddy caddy[1182]: {"level":"error","ts":1706239274.6171277,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"172.16.120.12:8083","duration":0.454309529,"request":{"remote_ip":"108.162.241.184","remote_port":"30260","client_ip":"108.162.241.184","proto":"HTTP/2.0","method":"GET","host":"library.hellmouth.ca","uri":"/cover/1995/sm?c=1705106258","headers":{"Sec-Fetch-Dest":["image"],"X-Forwarded-For":["108.162.241.184"],"Cf-Ipcountry":["CA"],"Priority":["u=4"],"Cf-Connecting-Ip":["MY.IP.ADDRESS"],"X-Scheme":["https"],"Sec-Fetch-Mode":["no-cors"],"X-Forwarded-Proto":["https"],"Accept":["image/avif,image/webp,*/*"],"Cf-Ray":["84b59e890ab336b5-YYZ"],"X-Forwarded-Host":["library.hellmouth.ca"],"Accept-Language":["en-US,en;q=0.5"],"Referer":["https://library.hellmouth.ca/"],"Sec-Fetch-Site":["same-origin"],"Cookie":[],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Cdn-Loop":["cloudflare"],"Accept-Encoding":["gzip"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","server_name":"library.hellmouth.ca"}},"error":"writing: write tcp 172.16.120.90:443->108.162.241.184:30260: write: connection reset by peer"}
Jan 26 03:21:15 caddy caddy[1182]: {"level":"error","ts":1706239275.1286507,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"172.16.120.12:8083","duration":0.098117157,"request":{"remote_ip":"108.162.241.184","remote_port":"29812","client_ip":"108.162.241.184","proto":"HTTP/2.0","method":"GET","host":"library.hellmouth.ca","uri":"/cover/2030/sm?c=1705106370","headers":{"Accept-Language":["en-US,en;q=0.5"],"Sec-Fetch-Site":["same-origin"],"Sec-Fetch-Mode":["no-cors"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Cf-Connecting-Ip":["MY.IP.ADDRESS"],"Referer":["https://library.hellmouth.ca/"],"Cf-Ray":["84b59e88ea4836b5-YYZ"],"X-Forwarded-For":["108.162.241.184"],"X-Scheme":["https"],"Accept-Encoding":["gzip"],"Cookie":[],"Priority":["u=4"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0"],"Cf-Ipcountry":["CA"],"Cdn-Loop":["cloudflare"],"X-Forwarded-Host":["library.hellmouth.ca"],"Sec-Fetch-Dest":["image"],"Accept":["image/avif,image/webp,*/*"],"X-Forwarded-Proto":["https"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","server_name":"library.hellmouth.ca"}},"error":"writing: client disconnected"}
3. Caddy version:
v2.7.6
4. How I installed and ran Caddy:
a. System environment:
I also edited the
systemd on Ubuntu server 22.04.3 - virtualized on Proxmox
b. Command:
systemctl start caddy
I have also edited the systemctl file to add the Cloudflare API token
[Service]
Environment="CF_API_TOKEN=I actually put my token in here"
c. Service/unit/compose file:
d. My complete Caddy config:
food.hellmouth.ca {
reverse_proxy 172.16.120.12:3026
}
library.hellmouth.ca {
reverse_proxy 172.16.120.12:8083 {
header_up X-Scheme https
}
5. Links to relevant resources:
https://caddy.community/t/calibre-web-reverse-proxy-help/12023
https://caddy.community/t/calibre-web-giving-502-error-behind-caddy/19801