Skip to content

Instantly share code, notes, and snippets.

@kworthington
Last active October 21, 2016 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kworthington/5537dd47defd197daed669bc01b1adaf to your computer and use it in GitHub Desktop.
Save kworthington/5537dd47defd197daed669bc01b1adaf to your computer and use it in GitHub Desktop.
# 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