Last active
August 12, 2019 09:56
-
-
Save pankpan/84e585079974c19d1c764aa3d1f217f8 to your computer and use it in GitHub Desktop.
Caddyfile sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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