/data for the site is not a good idea,
/data is where Caddy stores its certificates and other information. You should not be putting your site there.
/srv is better.
Thanks, I had literally just upgraded from caddy 1 to 2 so I haven’t looked carefully through the docs yet good to know
You didn’t have proper volumes for
/config , so you would lose your certificates if you tear down your containers. This is not good, and you may hit rate limits if something goes wrong and you get stuck in a reboot loop.
Uhm… well yeah that’s correct, but the way I am using it currently it doesn’t really matter saving the settings as I literally just use it as a php cgi / web server, the certificates / gzip, etc are handled by another reverse proxy I have in front of it Traefik that’s why I actually forgot to create volumes. But yeah if using caddy as the main entrance you’d better keep that data!
You should use the
caddy docker image, not
caddy/caddy . The former is the official docker image, the later is the “old official”. Both work, but it’s best to just use the actual official image.
Thanks again! It moved so fast didn’t notice it had become an official docker image. whoever would still recommend using the alpine version or at least setting up a fixed tag
encode gzip , there’s never a situation where you don’t want it on, really.
As I said on my setup Traefilk does that for me you probably woulnt want double zip! but yeah if nothing else in at front that option should be always on
header_up stuff is not necessary. If your Laravel app is triggering a redirect, it would be due to an app misconfiguration. Is your
APP_URL in your
.env not set correctly?
That probably might be because my Traefilk already adds the headers… and then Caddy somehow gets confused! I will investigate further Thanks!