3
$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"
}

Above is an extract of my lighttpd.conf. example.com and example.org are working fine. Any idea why api.example.com refuses to work?

Thanks!

James
  • 171
  • 1
  • 3
  • 15

1 Answers1

3

Make sure "api.example.com" resolves to the IP of your server in DNS.

emills
  • 774
  • 1
  • 4
  • 15