Hi, I’m trying to setup my instance of hugo behind Caddy using the plugin http.hugo the problem is that executing caddy -conf config_file the server starts correctly but visiting the website will not show the blog but just a redirection error. Here is the config file:
0xme.me {
gzip
hugo ./0xme / {
database 123456.db
}
tls {
dns cloudflare
}
log ./access.log
}
0xme is the directory containg hugo
caddy -conf config
Activating privacy features... done.
https://0xme.me
http://0xme.me
WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with "ulimit -n 8192".
EDIT:
I tried a minimal config on two different domains, one with cloudflare and one without, the one with cloudflare gives the redirect error so I’m suspecting it’s a problem with it. Any known issue?
That’s expected behaviour for an orange-cloud domain on Cloudflare. You’re not connecting to Caddy, you’re connecting to CF, who then connect to Caddy on your behalf (over HTTPS).
Yes, grey-cloud your domain in Cloudflare’s settings. Cloudflare will then answer DNS requests with the IP address of the origin server (your Caddy server), and clients will connect directly to that instead - thus being served the LetsEncrypt certificate.
Doing this will disable Cloudflare’s protection, caching, and other non-DNS features.