Skip to content

Commit

Permalink
Add curly braces to domain in Caddyfile (#3115)
Browse files Browse the repository at this point in the history
* Add curly braces to domain in Caddyfile

Adding curly braces after the domain name, allows for multiple deploys in the same server.

* regenerate doc for docs/recipe/provision/website.md

Co-authored-by: Victor van Herpt Valdivia <victor@vhvLaptop.lan>
  • Loading branch information
victor-vanherpt and Victor van Herpt Valdivia authored Apr 27, 2022
1 parent a617327 commit 764d3cd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/recipe/provision/website.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ Provision website.


### logs:caddy
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L81)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L82)

Shows caddy logs.




### logs:caddy:syslog
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L86)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L87)

Shows caddy syslog.

Expand Down
33 changes: 17 additions & 16 deletions recipe/provision/website.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,26 @@
run("chgrp caddy log");

$caddyfile = <<<EOF
$domain
$domain {
root * $deployPath/current/$publicPath
file_server
php_fastcgi * unix//run/php/php$phpVersion-fpm.sock {
\tresolve_root_symlink
}
log {
\toutput file $deployPath/log/access.log
}
\troot * $deployPath/current/$publicPath
\tfile_server
\tphp_fastcgi * unix//run/php/php$phpVersion-fpm.sock {
\t\tresolve_root_symlink
\t}
handle_errors {
\t@404 {
\t\texpression {http.error.status_code} == 404
\tlog {
\t\toutput file $deployPath/log/access.log
\t}
\trewrite @404 /404.html
\tfile_server {
\t\troot /var/dep/html
\thandle_errors {
\t\t@404 {
\t\t\texpression {http.error.status_code} == 404
\t\t}
\t\trewrite @404 /404.html
\t\tfile_server {
\t\t\troot /var/dep/html
\t\t}
\t}
}
EOF;
Expand Down

0 comments on commit 764d3cd

Please sign in to comment.