Preamble / Hi I’m new to the forum/caddy
I’m trying to setup Caddy to host a few static websites on a small cloud server and I’m very excited about this project-it looks really great (cudos to the devs).
The docs seem to be very though, but “context” or “how to use/adapt/integrate the info” has been a challange. (Note to doc team, one or two “real life” examples for deploying a real server would really help.) I understand that Caddy can be configured with a jason API, but if I’m using a Caddyfile, I have been having difficulty translating JSON docs to use with a simple Caddyfile.
I was able to follow the "get started tutorials and do simple things locally, but when I had to put it together on a bare VPS in the cloud where security matters, and I need to get let’s encrypt work etc. I have really been struggling for several days.
My Use Case
I want to host a couple of static sites, and one or two small low traffic wordpress sites on a small cloud server.
QUESTION 1: Should I use a reverse proxy
Should I be using separate instances of Caddy – one for reverse proxy, and one or more instances to serve the site(s)? Given that my use case is simple and everything lives in one place is there any advantage to doing a reverse proxy over a single instance (security?)?
QUESTION 2:
Assuming these were real domains (with proper DNS, and the WordPress/php was correct, real email address) should this Caddyfile work or is there anything else required to have all the https:// work? Is setting up an account wiht Let’s Encrypt required, or do I need to add any special txt records to my DNS? I am having difficulty determining if I have a server setup problem or a “caddy” problem.
{
email myemail@somedomain.com
acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
example1.com {
root * /www/example1.com
file_server
}
example2.com {
root * /www/example2.com
file_server
}
example3.com {
root * /www/example3.com
file_server
}
examplewp1.com {
root * /www/examplewp1.com
# Whatever is needed for WordPress
# Haven't figured that out yet.
file_server
}
examplewp2.com {
root * /www/examplewp2.com
# Whatever is needed for WordPress
# Haven't figured that out yet.
file_server
}
#
# If I wanted to add a reverse proxy for a microservice
# would it be OK to add for a simple use case like this?
#
example4.com {
reverse_proxy localhost:9000
}
Thanks in advance for any advice/helpful feferences – sorry I couldn’t follow the prescribed format.