Skip to content

Instantly share code, notes, and snippets.

@pankpan
Last active August 12, 2019 09:56
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 pankpan/84e585079974c19d1c764aa3d1f217f8 to your computer and use it in GitHub Desktop.
Save pankpan/84e585079974c19d1c764aa3d1f217f8 to your computer and use it in GitHub Desktop.
Caddyfile sample
https://domain1.com https://www.domain1.com {
root /var/www/html
log /var/log/caddy/access.log
errors /var/log/caddy/errors.log
tls your@email.com # auto https with let's encrypt
gzip
fastcgi / localhost:9000 php
}
https://domain2.com https://www.domain2.com {
root /var/www/html
log /var/log/caddy/access.log
errors /var/log/caddy/errors.log
tls /etc/caddy/fullchain.pem /etc/caddy/privkey.pem # use exist certificate
gzip
fastcgi / localhost:9000 php
}
http://domain1.com http://www.domain1.com {
root /var/www/html
log /var/log/caddy/access.log
errors /var/log/caddy/errors.log
tls off
gzip
fastcgi / localhost:9000 php
rewrite {
if {file} not index.php
if {dir} not /test/
to index.php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment