I have used Caddy to serve live websites but I have never personally tried installing to push localhost server applications like a couple Wordpress local test sites.
I am using Virtual Box on a windows machine. I have a singular VM running Ubuntu 18.04 LTS and have created several LXD 3.0 containers, each with the purpose of hosting a single WordPress site. The config looks like this:
HOST MACHINE – Ubuntu 18.04
[container01] —> WordPress site 1
[container02] —> WordPress site 2
[container03] —> WordPress site 3
Each container is composed of a simple stack to push WordPress:
- Ubuntu 18.04 Server
- PHP/7
- MySQL
- Caddy
My question is: How do I enable Caddy features on a local server environment? Is there a way I can turn off automatic certificate grabbing/renewal?
I know how to mark up the caddy.file for live production (insert live domain & valid email). Is there a way I can insert a single container IP address? or simply input ‘localhost’ ?
www.example.com { <-- (do I put 'localhost' here?)
tls admin@example.com <-- (can I try 'tls off')
root /var/www/wordpress
gzip
minify
header / {
Cache-Control "max-age=86400"
Strict-Transport-Security "max-age=31536000;"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
}
header /wp-admin {
Cache-Control no-cache
}
fastcgi / /run/php/php7.0-fpm.sock php
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
