Installing Discourse With Caddy (Docker Compose) (hetzner Cloud)

1. The problem I’m having:

I am experiencing an error when trying to connect to my second site that is linked to /var/discourse/shared/standalone/nginx.http.sock (Discourse). The error message states that the file unix//var/discourse/shared/standalone/nginx.http.sock does not exist, although it actually exists with the correct file permissions.

2. Error messages and/or full log output:

root@ans:~/n8n-docker-caddy# docker compose logs -f
n8n-docker-caddy-n8n-1    | License manager not initialized
n8n-docker-caddy-n8n-1    | n8n ready on 0.0.0.0, port 5678
n8n-docker-caddy-n8n-1    | Initializing n8n process
n8n-docker-caddy-n8n-1    | Version: 0.230.3
n8n-docker-caddy-n8n-1    |  ================================
n8n-docker-caddy-n8n-1    |    Start Active Workflows:
n8n-docker-caddy-n8n-1    |  ================================
n8n-docker-caddy-n8n-1    |    - Arab Payments Bot - Affiliate Results (ID: 2)
n8n-docker-caddy-n8n-1    |      => Started
n8n-docker-caddy-n8n-1    | 
n8n-docker-caddy-n8n-1    | Editor is now accessible via:
n8n-docker-caddy-n8n-1    | https://slave.iraki.net:5678/
n8n-docker-caddy-n8n-1    | 
n8n-docker-caddy-n8n-1    | Stopping n8n...
n8n-docker-caddy-n8n-1    | License manager not initialized
n8n-docker-caddy-n8n-1    | n8n ready on 0.0.0.0, port 5678
n8n-docker-caddy-n8n-1    | Initializing n8n process
n8n-docker-caddy-n8n-1    | Version: 0.230.3
n8n-docker-caddy-n8n-1    |  ================================
n8n-docker-caddy-n8n-1    |    Start Active Workflows:
n8n-docker-caddy-n8n-1    |  ================================
n8n-docker-caddy-n8n-1    |    - Arab Payments Bot - Affiliate Results (ID: 2)
n8n-docker-caddy-n8n-1    |      => Started
n8n-docker-caddy-n8n-1    | 
n8n-docker-caddy-n8n-1    | Editor is now accessible via:
n8n-docker-caddy-n8n-1    | https://slave.iraki.net:5678/
n8n-docker-caddy-n8n-1    | 
n8n-docker-caddy-n8n-1    | Stopping n8n...
n8n-docker-caddy-n8n-1    | License manager not initialized
n8n-docker-caddy-n8n-1    | n8n ready on 0.0.0.0, port 5678
n8n-docker-caddy-n8n-1    | Initializing n8n process
n8n-docker-caddy-n8n-1    | Version: 0.230.3
n8n-docker-caddy-n8n-1    |  ================================
n8n-docker-caddy-n8n-1    |    Start Active Workflows:
n8n-docker-caddy-n8n-1    |  ================================
n8n-docker-caddy-n8n-1    |    - Arab Payments Bot - Affiliate Results (ID: 2)
n8n-docker-caddy-n8n-1    |      => Started
n8n-docker-caddy-n8n-1    | 
n8n-docker-caddy-n8n-1    | Editor is now accessible via:
n8n-docker-caddy-n8n-1    | https://slave.iraki.net:5678/
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4748743,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
n8n-docker-caddy-caddy-1  | {"level":"warn","ts":1686429858.4784064,"msg":"Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":2}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4795794,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.480117,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4801714,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4802504,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x400020ff10"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.480576,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4806697,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size for details."}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4807742,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4808404,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4808657,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["forum.iraki.net","slave.iraki.net"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4853153,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4856777,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.4857264,"msg":"serving initial configuration"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429858.487689,"logger":"tls","msg":"finished cleaning storage units"}
n8n-docker-caddy-caddy-1  | {"level":"error","ts":1686429892.992121,"logger":"http.log.error","msg":"dial unix /sock/app/nginx.http.sock: connect: no such file or directory","request":{"remote_ip":"88.240.177.249","remote_port":"25526","proto":"HTTP/2.0","method":"GET","host":"forum.iraki.net","uri":"/","headers":{"Sec-Fetch-User":["?1"],"Cookie":[],"Cache-Control":["max-age=0"],"Sec-Fetch-Site":["cross-site"],"Sec-Fetch-Dest":["document"],"Accept-Language":["en-US,en;q=0.9,ar;q=0.8,tr;q=0.7"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Sec-Fetch-Mode":["navigate"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Ch-Ua-Platform":["\"Windows\""],"Dnt":["1"],"Upgrade-Insecure-Requests":["1"],"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\""]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"forum.iraki.net"}},"duration":0.00036856,"status":502,"err_id":"7ecudt687","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429963.8318439,"msg":"shutting down apps, then terminating","signal":"SIGTERM"}
n8n-docker-caddy-caddy-1  | {"level":"warn","ts":1686429963.8318765,"msg":"exiting; byeee!! 👋","signal":"SIGTERM"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429964.8807435,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0x400020ff10"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429964.8808823,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429964.8809004,"msg":"shutdown complete","signal":"SIGTERM","exit_code":0}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.7966647,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
n8n-docker-caddy-caddy-1  | {"level":"warn","ts":1686429965.806387,"msg":"Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":2}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.807623,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.8082845,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.808348,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.8085074,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x40001dd8f0"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.80864,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.808808,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.8095894,"logger":"tls","msg":"finished cleaning storage units"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.8096275,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size for details."}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.8104308,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.810629,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.8106604,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["slave.iraki.net","forum.iraki.net"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.8124692,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686429965.8124876,"msg":"serving initial configuration"}
n8n-docker-caddy-caddy-1  | {"level":"error","ts":1686429972.5117133,"logger":"http.log.error","msg":"dial unix /sock/app/nginx.http.sock: connect: no such file or directory","request":{"remote_ip":"88.240.177.249","remote_port":"27564","proto":"HTTP/2.0","method":"GET","host":"forum.iraki.net","uri":"/","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Sec-Fetch-Mode":["navigate"],"Accept-Language":["en-US,en;q=0.9,ar;q=0.8,tr;q=0.7"],"Cookie":[],"Cache-Control":["max-age=0"],"Dnt":["1"],"Sec-Fetch-Dest":["document"],"Sec-Fetch-Site":["cross-site"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Ch-Ua-Platform":["\"Windows\""],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-User":["?1"],"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\""],"Sec-Ch-Ua-Mobile":["?0"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"forum.iraki.net"}},"duration":0.0003386,"status":502,"err_id":"hj4tvx866","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}
n8n-docker-caddy-caddy-1  | {"level":"error","ts":1686430043.3736558,"logger":"http.log.error","msg":"dial unix /sock/app/nginx.http.sock: connect: no such file or directory","request":{"remote_ip":"88.240.177.249","remote_port":"28284","proto":"HTTP/2.0","method":"GET","host":"forum.iraki.net","uri":"/","headers":{"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\""],"Sec-Ch-Ua-Mobile":["?0"],"Dnt":["1"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br"],"Cookie":[],"Cache-Control":["max-age=0"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Site":["cross-site"],"Sec-Ch-Ua-Platform":["\"Windows\""],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-User":["?1"],"Accept-Language":["en-US,en;q=0.9,ar;q=0.8,tr;q=0.7"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"forum.iraki.net"}},"duration":0.0004306,"status":502,"err_id":"tjhu10pw3","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430099.9312456,"msg":"shutting down apps, then terminating","signal":"SIGTERM"}
n8n-docker-caddy-caddy-1  | {"level":"warn","ts":1686430099.9313042,"msg":"exiting; byeee!! 👋","signal":"SIGTERM"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.019809,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0x40001dd8f0"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.0199602,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.0199733,"msg":"shutdown complete","signal":"SIGTERM","exit_code":0}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.87129,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
n8n-docker-caddy-caddy-1  | {"level":"warn","ts":1686430101.8723376,"msg":"Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":2}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8730698,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8737273,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8737485,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8738291,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x4000184d90"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8740454,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8741136,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size for details."}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8741047,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8741655,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8741896,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8741932,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["slave.iraki.net","forum.iraki.net"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8750796,"logger":"tls","msg":"finished cleaning storage units"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8753147,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430101.8753328,"msg":"serving initial configuration"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430372.3080103,"msg":"shutting down apps, then terminating","signal":"SIGTERM"}
n8n-docker-caddy-caddy-1  | {"level":"warn","ts":1686430372.3080487,"msg":"exiting; byeee!! 👋","signal":"SIGTERM"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430372.3083127,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0x4000184d90"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430372.3083563,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430372.308363,"msg":"shutdown complete","signal":"SIGTERM","exit_code":0}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3484356,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
n8n-docker-caddy-caddy-1  | {"level":"warn","ts":1686430373.3494737,"msg":"Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":2}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3501465,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3506522,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3506715,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3509693,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x400002d260"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3509724,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3510244,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3516517,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size for details."}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3518105,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.352053,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.352066,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["slave.iraki.net","forum.iraki.net"]}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.352665,"logger":"tls","msg":"finished cleaning storage units"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.356884,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
n8n-docker-caddy-caddy-1  | {"level":"info","ts":1686430373.3569167,"msg":"serving initial configuration"}
n8n-docker-caddy-caddy-1  | {"level":"error","ts":1686430435.546539,"logger":"http.log.error","msg":"dial unix /var/discourse/shared/standalone/nginx.http.sock: connect: no such file or directory","request":{"remote_ip":"88.240.177.249","remote_port":"27813","proto":"HTTP/2.0","method":"GET","host":"forum.iraki.net","uri":"/","headers":{"Dnt":["1"],"Sec-Fetch-Mode":["navigate"],"Accept-Encoding":["gzip, deflate, br"],"Cache-Control":["max-age=0"],"Sec-Ch-Ua-Mobile":["?0"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Sec-Fetch-Site":["cross-site"],"Sec-Fetch-Dest":["document"],"Accept-Language":["en-US,en;q=0.9,ar;q=0.8,tr;q=0.7"],"Cookie":[],"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\""],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"],"Sec-Fetch-User":["?1"],"Upgrade-Insecure-Requests":["1"],"Sec-Ch-Ua-Platform":["\"Windows\""]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"forum.iraki.net"}},"duration":0.00050996,"status":502,"err_id":"i9z5e0g5x","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}
n8n-docker-caddy-caddy-1  | {"level":"error","ts":1686430915.5717509,"logger":"http.log.error","msg":"dial unix /var/discourse/shared/standalone/nginx.http.sock: connect: no such file or directory","request":{"remote_ip":"88.240.177.249","remote_port":"26071","proto":"HTTP/2.0","method":"GET","host":"forum.iraki.net","uri":"/","headers":{"Sec-Fetch-Site":["cross-site"],"Sec-Fetch-User":["?1"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Sec-Ch-Ua-Platform":["\"Windows\""],"Dnt":["1"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br"],"Cache-Control":["max-age=0"],"Sec-Ch-Ua-Mobile":["?0"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"],"Accept-Language":["en-US,en;q=0.9,ar;q=0.8,tr;q=0.7"],"Cookie":[],"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\""],"Upgrade-Insecure-Requests":["1"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"forum.iraki.net"}},"duration":0.00023116,"status":502,"err_id":"db0vaqhft","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}
n8n-docker-caddy-caddy-1  | {"level":"error","ts":1686431767.498194,"logger":"http.log.error","msg":"dial unix /var/discourse/shared/standalone/nginx.http.sock: connect: no such file or directory","request":{"remote_ip":"88.240.177.249","remote_port":"29378","proto":"HTTP/2.0","method":"GET","host":"forum.iraki.net","uri":"/","headers":{"Cache-Control":["max-age=0"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Site":["cross-site"],"Cookie":[],"Sec-Ch-Ua-Mobile":["?0"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Dnt":["1"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-User":["?1"],"Accept-Encoding":["gzip, deflate, br"],"Accept-Language":["en-US,en;q=0.9,ar;q=0.8,tr;q=0.7"],"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\""],"Sec-Ch-Ua-Platform":["\"Windows\""],"Sec-Fetch-Dest":["document"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"forum.iraki.net"}},"duration":0.00043552,"status":502,"err_id":"yvhwz135t","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}
n8n-docker-caddy-caddy-1  | {"level":"error","ts":1686432187.0474243,"logger":"http.log.error","msg":"dial unix /var/discourse/shared/standalone/nginx.http.sock: connect: no such file or directory","request":{"remote_ip":"88.240.177.249","remote_port":"28283","proto":"HTTP/2.0","method":"GET","host":"forum.iraki.net","uri":"/","headers":{"Cache-Control":["max-age=0"],"Sec-Ch-Ua-Platform":["\"Windows\""],"Dnt":["1"],"Upgrade-Insecure-Requests":["1"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"],"Accept-Language":["en-US,en;q=0.9,ar;q=0.8,tr;q=0.7"],"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\""],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Cookie":[],"Sec-Fetch-Site":["cross-site"],"Sec-Fetch-Mode":["navigate"],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Fetch-User":["?1"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"forum.iraki.net"}},"duration":0.0002062,"status":502,"err_id":"8g9q2wbxx","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}
n8n-docker-caddy-caddy-1  | {"level":"error","ts":1686436714.7947006,"logger":"http.log.error","msg":"dial unix /var/discourse/shared/standalone/nginx.http.sock: connect: no such file or directory","request":{"remote_ip":"88.240.177.249","remote_port":"26468","proto":"HTTP/2.0","method":"GET","host":"forum.iraki.net","uri":"/","headers":{"Cookie":[],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Fetch-Dest":["document"],"Sec-Ch-Ua-Platform":["\"Windows\""],"Accept-Language":["en-US,en;q=0.9,ar;q=0.8,tr;q=0.7"],"Sec-Fetch-Mode":["navigate"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\""],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.37"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"Dnt":["1"],"Upgrade-Insecure-Requests":["1"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"forum.iraki.net"}},"duration":0.00089656,"status":502,"err_id":"jawzhd5v2","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}

3. Caddy version:

v2.6.4

4. How I installed and ran Caddy:

Installed it for the first time using the official docker image through N8N official installation, Source / (Hetzner)

a. System environment:

### System Environment ###

OS: Ubuntu 22.04.2 LTS
Kernel: Linux 5.15.0-73-generic (aarch64)
Systemd: Running
Docker Client: 23.0.3 (API version: 1.42)
Docker Server: 24.0.2 (API version: 1.43)

b. Command:

cd n8n-docker-caddy
docker compose up --build
sudo nano /root/n8n-docker-caddy/caddy_config/Caddyfile
sudo nano /root/n8n-docker-caddy/docker-compose.yml

c. Docker Compose file:

version: "3.7"

services:
  caddy:
    image: caddy:latest
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "80:80/udp"
      - "443:443/udp"
    volumes:
      - ${DISCOURSE_PATH}/shared:/sock
      - ${DATA_FOLDER}/caddy_data:/data
      - ${DATA_FOLDER}/caddy_config:/config
      - ${DATA_FOLDER}/caddy_config/Caddyfile:/etc/caddy/Caddyfile

  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - 5678:5678
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER
      - N8N_BASIC_AUTH_PASSWORD
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
    volumes:
      - ${DATA_FOLDER}/local_files:/files
      - ${DATA_FOLDER}/.n8n:/home/node/.n8n

volumes:
  caddy_data:
    external: true
  caddy_config:

d. My complete Caddy config:

{
    # Global options go here
}

slave.iraki.net {
    reverse_proxy n8n-docker-caddy-n8n-1:5678 {
        flush_interval -1
    }
}

forum.iraki.net {
    reverse_proxy / unix//var/discourse/shared/standalone/nginx.http.sock 
}

Vaildate results:

/config # caddy validate --config /config/Caddyfile
2023/06/10 22:37:43.830 INFO    using provided configuration    {"config_file": "/config/Caddyfile", "config_adapter": ""}
2023/06/10 22:37:43.831 WARN    Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies    {"adapter": "caddyfile", "file": "/config/Caddyfile", "line": 2}
2023/06/10 22:37:43.831 INFO    http    server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2023/06/10 22:37:43.831 INFO    tls.cache.maintenance   started background certificate maintenance      {"cache": "0x40001ae700"}
2023/06/10 22:37:43.831 INFO    http    enabling automatic HTTP->HTTPS redirects        {"server_name": "srv0"}
2023/06/10 22:37:43.832 INFO    tls.cache.maintenance   stopped background certificate maintenance      {"cache": "0x40001ae700"}
Valid configuration

5. Links to relevant resources:

- https://meta.discourse.org/t/installing-discourse-with-n8n-using-caddy-in-same-cloud-server-hetzner-cloud/267709
- https://meta.discourse.org/t/use-caddy-instead-of-ngnix-as-your-reverse-proxy/54716
- https://caddy.community/t/discourse-with-caddy-v2-in-docker/9244 

You can probably simply do reverse_proxy n8n:5678. You don’t need the full container name, you can use the service name. And you probably don’t need flush_interval -1, Caddy should automatically detect if it’s needed for the given request.

reverse_proxy / will only proxy requests to exactly / and nothing else. Remove that /, it’s probably not what you intended.

Also, I don’t see /var/discourse mounted to Caddy’s container. Are you sure that’s the correct path? Shouldn’t it be unix//sock/standalone/nginx.http.sock, maybe?

You don’t need this line, Caddy only needs UDP for port 443 (HTTP/3) not port 80.

You probably don’t need this either, this is exposing that service to anything which can connect to your server. If you remove it, you can be sure all the traffic went through Caddy first and used HTTPS.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.