How to configure main site and subdomains?

Hi All,

I have just come across Caddy and it looks like it will be more than capable of handling the simple case that I need.

Currently, I am trying to work my way through the documentation and on the hunt for a simple example of a way take a some website on the same machine and have a main site and subdomains for the others.

As an example, I want:

www.example.com (main site) — static pages
docs.example.com (subdomain) — web pages in a separate directory
explorer.example.com (subdomain) — web pages in a separate directory
.
.
.
and other subdomains under example.com

How can I easily set up a caddy config for this so that have them all under a LetsEncrypt certificate (HTTPS) and basically the whole website looks homogeneous to the user.

I am sure that this is a simple and common case, but if someone could please guide me in the right direction or show me an similar type example then that would be of huge help.

I am also guessing that I could go into the main director and just do a “caddy run” or something like that to start it all up, correct.

Sorry for still being very new to Caddy

Have you read through the docs? Have you read through the getting started guide?

Make sure to also read the Caddyfile Concepts page which explains how the Caddyfile is structured and how you would define multiple sites: Caddyfile Concepts — Caddy Documentation

How did you install Caddy?

You haven’t filled out the help topic template so I don’t know what you’ve tried so far. Please do so.

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