When we use NGINX, we have dynamic upstream servers (camera devices). So, you can add a new camera in the interface. This writes out some NGINX upstream config files, then NGINX is retarted. The NGINX main config (default) has this:
# upstreams
include sites-available/*.upstream;
include sites-available/*.conf;
So when NGINX is restarted, it reads the new config files.
You can use the Caddyfile with the API, but you lose the ability to make granular config changes when using a config adapter. (Also: donât restart the server for config changes, reload the config instead!)
For more advanced, dynamic setups like what you have, is suggest possibly using json with the API, it makes it very easy to add and remove backends. Managing multiple config files is usually more trouble than itâs worth anyway.
At work, I am writing up a Confluence page on why we should switch to Caddy from NGINX. I have to do due diligence and provide Pros and Cons. Even for Caddy itself, vis a vis Caddyfile vs JSON configs, etc.
I have learned a LOT in the past few days. I really appreciate you guys answering my questions and giving help, so we can make this decision soon.
I love dynamic communities where people pitch in to help others.
For our needs, I think we will be going the JSON route, so we can add upstream servers dynamically.
One thing I donât understand, is when a computer is reboooted, will the service start up similar to caddy run --reload?
Cool, thanks for putting effort into learning about it
Using our standard service file, which has the --resume flag youâll notice, Caddy will resume its last active configuration upon starting up, overriding the --config flag if present. This avoids data (config) loss when using the API after the initial config file is loaded.
Were our docs helpful in your journey? Anything significant we should improve about them?
@matt I have to say, the docs were very confusing for beginners trying to find something. In fact, Iâd go so far to say, if you canât find the information readily available right away, some would leave (like waiting for a browser page to display - I think the attention span is like 6 seconds). Anyway, what I did learn was from you and @francislavoie (thank goodness!). Once I started learning some things from you guys, I was able to traverse the docs a bit better to find more information.
I think there needs to be more examples. The problem with that is everyoneâs needs are a bit different. And, I know from experience, if you put up examples, they copy directly and then complain when it doesnât work for them.
I really like Caddy, or at least the concept of it, which kept me pursuing what needed to be done. Obviously, I am still learning. I was given a couple more days for the investigation, because a Thursday meeting we had about it I was able to show promising results. If we decide to go with Caddy, I will be back and get a bit more involved. Unfortunately, they wonât be doing any sponsoring, considering the circumstances. Last Tuesday, everyoneâs salaries dropped 40% so no one would be let go.
But, I would certainly help out in the docs area, from a newbie perspective. As you can see, I am hugely motivated in FOSS (hawkeye64 (Jeff Galbraith) · GitHub).
Specifically, this page. JSON Config Structure - Caddy Documentation and this page: JSON Config Structure - Caddy Documentation . It left me very confused, even after reading the explanations below. I felt very lost. A lot of âyeah, but howâŠ?â came to mind. I think that you have to drill down (which is an interesting concept) is part of it. I wouldnât change the docs, but maybe a ârelatedâ araea or something. Trying to find the âuriâ part (for uri replace /web_app_socket /web/socket.io is still a bit of a chore).
In fact, I still havenât found that information. I get this far to routes but not route
What couldnât you find in ~6 seconds?
Thatâs not what I meant actually. Thatâs in correlation to a web page spining up aka lighthouse info.
No worries. Thatâs a tough situation. Take care!
Yes, and you take care as well. The world is definiately not right currently and precautions all around are needed. We just did our first online grocery shopping. Itâs all backed up, so we get it a week from monday (tomorrow), so an 8 day wait.
Hmm, pretty easy. In the sidebar, Caddyfile > Directives > in the table > uri
Thatâs fine, thatâs really meant to be a structure reference than a âhow to useâ.
Iâm confused, why are you looking in the JSON docs for Caddyfile information? Those are two separate things. Caddyfile syntax adapts to JSON, but it is not a 1:1 match at all, it has all kinds of tricks to improve config UX.
To be fair, we could do a better job at linking the two, at least in the descriptions/paragraphs, so that people can find some correspondence between them.
But yeah, itâs tricky because directives donât necessarily map 1:1 with JSON structures. Theyâre two totally different ways at configuring Caddy.
Iâll see what we can do about this. Maybe itâs just a matter of adding a sentence near the top like âTo craft a basic HTTP server, âŠâ
Again, I am misunderstood with this respect. I was just giving an analogy on attention span only. For different items, like web pages, itâs low. For other things itâs high. I still donât think I am conveying properly. Except to say, if the reviewer doesnât find answers right away they are likely to get 1) frustration, followed by 2) desparation, then 3) give up.
To be honest, I am not really criticizing, just trying to help.
Iâm confused, why are you looking in the JSON docs for Caddyfile information? Those are two separate things. Caddyfile syntax adapts to JSON, but it is not a 1:1 match at all, it has all kinds of tricks to improve config UX.
As I mentioned before, I had to write docs with pros and cons. That included Caddyfile vs JSON config
Going back to trying to find the correct info, one thing that made it more difficult for me was all of the v1 information around the web. But, I did start to see the differences, so when Iâd find a medium article, I could recognize that it was v1.
Again, I am just tryingh to âtapâ my expereince as a newbie before I get too âexperiencedâ at it and forget the struggles I went through. And, I am only doing this to help Caddy grow.
Aye, we appreciate that feedback a lot. Weâre just trying to map out those pain points with precision so we can see whatâs actionable, hopefully it doesnât seem like weâre trying to put you on the spot and grill you over it.
I also find that information which is found on the web is mostly for Caddy V1, and here in Europe we also have the Problem that Caddy is also a Car Type from Volkswagen which doesnt make searching information on the internet a lot easier (they also have a Caddy 2 ) .
Maybe some full examples would be fine, or a complete config with all default values if there are some.
but nevertheless i think Caddy is a superb piece of Software, keep up the good work !