Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# example WordPress configuration for Caddy as used on kevindustries.com.
# Ubuntu 14.04.5, PHP 5.5.9, MySQL 5.5.52, Caddy 0.9.3. Last updated 20 October 2016 - Kevin Worthington
# Redirect all www. requests to base URL:
www.kevindustries.com {
redir https://kevindustries.com{uri}
}
kevindustries.com {
root /var/www/kevindustries.com
gzip
log /var/log/caddy/kevindustries.com.access.log
header / Strict-Transport-Security "max-age=31536000"
errors {
log /var/log/caddy/kevindustries.com.error.log
404 404 # Not Found
}
# using php5-fpm to manage processes
fastcgi / unix:/var/run/php5-fpm.sock php
# Routing for WordPress
rewrite / {
to {path} {path}/ /index.php?{query}
}
# PHPMyAdmin directory protected by basicauth as another layer of security; PMA is also password protected:
basicauth siteadmin <secretpassword-redacted> {
/phpmyadmin/
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment