Your error references a specific line in your Caddyfile (line 40). Unexpected EOF generally means the file ends while the parser is still expecting more arguments (unfinished site block? unfinished directive?).
If you post your current unredacted Caddyfile along with the error you’re getting with it, we can point to the specific problem.
So were almost there now i get an api token is missing error.
this is the correct way to register the api token. and no i didnt use the global api token. i made a specific one with zone.zone and zone.dns.
reverse_proxy 127.0.0.1:8096
tls {
dns cloudflare {cloudflare api key}
}
and yes i realized i accidently posted my api key ive already rolled it
okay im finally off the stupid syntax errros. now when i do command caddy reload caddyfile
i get this error
2020/06/08 07:15:35.878 ←[34mINFO←[0m using adjacent Caddyfile
reload: sending configuration to instance: performing request: Post "http://localhost:2019/load": dial tcp [::1]:2019: connectex: No connection could be made because the target machine actively refused it.
i dont even know why its trying to connect to port 2019 thats no where in my config
By default, Caddy listens on localhost:2019 for its config API. It’s how config reloads are done - it sends an HTTP request to that endpoint to push the new config.
so i do i push the new localhost:2019 to localhost:443 if im trying to run cloudflare and SSL
I’m sorry im a little confused on how to apply this with my caddy config. Could you possibly give me an example that would pertain to me?
i also thought this wasnt needed as im using a caddyfile instead of a json file
UPDATE #1:
Got it i had to type command caddy start
instead of caddy reload caddyfile
Just to be clear, Caddy always uses JSON as its configuration language. The Caddyfile is just syntax sugar to make it easier to write your config, but it’s parsed and adapted to JSON.
Caddy uses the config API internally to implement graceful reloads. It’s the most portable way to do this, because Caddy needs to run on all OSes and running an HTTP server is something that works everywhere.
If Caddy wasn’t running in the first place, then yes, reload won’t work. That wasn’t clear from your post. You need to run it before you can reload its configuration! Once it’s running, the recommended way to change the config is to use caddy reload to push the new config and do a zero downtime reload.
ive checkd all my cloudflare settings and im 99% sure my settings are setup correctly. the errror tells me the origin certificate is not registering. Is that becuase i have to set the the enviromental variables or would that not matter. ie. https://go-acme.github.io/lego/dns/cloudflare/
if so would i implement it like in version 1
setlocal
set CLOUDFLARE_EMAIL=ittechnut@hotmail.com
set CLOUDFLARE_API_KEY=bb90be4bf96e600a7ea7f4d5dee287ba3e542
start caddy run
thats in a .bat for windows
also is the clouflare api key going to be an api or global key
Update #1:
I got it working i had to port forward my ports for the domain because my upnp was not picking up the ports. its 100% resolved thank you to everyone who helped.