$HTTP["host"] == "example.com" {
server.document-root = "/var/www/vhosts/example.com/httpdocs/development/api"
server.errorlog = "/var/log/lighttpd/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"
}
$HTTP["host"] == "api.example.com" {
server.document-root = "/var/www/vhosts/example.com/httpdocs/development/api"
server.errorlog = "/var/log/lighttpd/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"
}
$HTTP["host"] == "example.org" {
server.document-root = "/var/www/vhosts/example.com/httpdocs/development/services"
server.errorlog = "/var/log/lighttpd/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"
}
以上是我的 lighttpd.conf 的摘录。example.com 和 example.org 运行正常。知道为什么 api.example.com 无法工作吗?
谢谢!
答案1
确保“api.example.com”在 DNS 中解析为您服务器的 IP。