我正在尝试使用多个虚拟主机配置Caddy FastCGI。据我所知,以下Caddyfile应该正常工作:
gzip
tls support@mydomain.com
errors /var/log/caddy/error.log
header / Strict-Transport-Security "max-age=15768000;"
portal.mydomain.info {
fastcgi / 127.0.0.1:3000 {
root /var/www/portal
ext .php
index index.php
}
}
urlf.mydomain.info {
fastcgi / 127.0.0.1:3001 {
root /var/www/urlf
ext .php
index index.php
}
}
但凯蒂未能错误地开始:
Feb 2 04:33:58 ip-172-31-24-38 caddy[3135]: 2018/02/02 04:33:58 /etc/caddy/Caddyfile:7 - Error during parsing: Unknown directive 'portal.mydomain.info'
答案 0 :(得分:1)
Caddyfile的第一行始终是要投放的网站的地址。
因此,您需要重新构建Caddy文件,以便所有指令都在网站定义中。 Here's a page describing the syntax in more technical (and visual) detail.