Collection of Caddy working examples?

Hello,

I’d like to ask if there is some collection of caddy working examples? I can read the docs, search the forum, ask for help and so on. However most of the time a working example seems the best way to get started (for me, and perhaps for people who learn best by examples).

Regards,
Tony

1 Like

The docs are full of examples.

I can’t help with vague requests like this, please ask a specific question. What are you looking for exactly?

thank you for your reply.

you are absolute right that the docs are full of examples which explain very well how something works. I also appreciate your heroic effort to help Caddy users in this forum and elsewhere that I have seen. I know that this takes a lot of time, effort and patience.

I don’t really have a specific problem right now; my question is about where I can learn from existing working examples. The docs are like reference: they are most helpful when I know what I am looking for. Working examples are complementary to docs: they help to understand how things are put together to achieve a concrete goal, which is useful to get started.

For example I first read about caddy via this place:

and find that extremely helpful in the beginning when everything is new to me. Writing docs is hard and time-consuming. I think a collection of Caddy configs of working instances for various scenarios is an efficient way to make caddy more accessible and probably has been done by someone, hence my question.

1 Like

The problem is the possibility space for things you can do with Caddy is infinite, so it’s impossible to cover everything. We have pages like Common Caddyfile Patterns — Caddy Documentation for some of this.

Also we encourage users to make posts in the Wiki - Caddy Community for more specific/targeted guides.

Again, I’m not sure how to answer this because you’re not really asking anything specific. This isn’t actionable feedback, because it doesn’t point out a specific problem we can address or work on.

for people who learn best by examples

There is an open issue for just this

I’ve found GH search to be useful
https://github.com/search?q=(path%3A**%2FCaddyfile+OR+path%3A**%2F*.caddy)&type=code

1 Like

Yeap, I agree with Tony. Second day searching by myself something like “simple boilerplate for usual web-site”.

Docs have almost zero info for newcomers IN WHOLE PICTURE.

This example of static server absolutely useless in terms of understanding what would be going on with that config:

example.com {
	root * /var/www
	file_server
}

Is it working? Yes. But better would be create full boilerplate with full web-site directories and files structure AND Docker(?) & Caddyfile for serving all these files.

Like “we have such usual static web-site structure”:

.
├── files
│   └── archive.zip
├── imgs
│   └── photo.jpg
├── index.html
└── theme2
    └── index.html

Where:

  • /files - only one directory allowed for browsing, here would be smth like FTP
  • /imgs - for images in HTML files
  • /theme2 - subdir for HTML files
  • index files would be “index.html” - working for all dirs and subdirs

“And here is Dockerfile and Caddyfile for it”.

Probably, there could be a few boilerplates with different usual use cases.

1 Like

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