Настройка Lighttpd vhost работает для подкаталогов - PullRequest
0 голосов
/ 15 марта 2012

У меня есть следующая настройка сопоставления для работы с подкаталогами, но с этим изменением не удалось запустить lighttpd, что-то не так? также где я могу найти системные журналы для lighttpd

[root @ localhost log] # /etc/init.d/lighttpd начать многословно Запуск lighttpd (через systemctl): задание не выполнено. Подробности смотрите в системных журналах и «статусе systemctl».

$SERVER["socket"] == "0.0.0.0:443" {
  ssl.engine                  = "enable"
  ssl.pemfile                 = "/etc/lighttpd/ssl/api.testdomain.com.pem"
  ssl.ca-file                 = "/etc/lighttpd/ssl/sub.class1.server.ca.pem.cer"

  $HTTP["host"] =~ "^api\.testdomain\.com" {
    $HTTP["url"] =~ "^/[^/]*\.json$" {
      server.name               = "api.testdomain.com"
      server.errorlog           = "/var/log/lighttpd/testdomain.com/server_error_443.log"
      accesslog.filename        = "/var/log/lighttpd/testdomain.com/server_access_443.log"
      proxy.server              = ( "" => ( ("host" => "127.0.0.1", "port" => 9001) ) )
    }
    else $HTTP["url"] = "^/v2/*\.json$" {
      server.name               = "api.testdomain.com"
      server.errorlog           = "/var/log/lighttpd/testdomain.com/server_error_443.log"
      accesslog.filename        = "/var/log/lighttpd/testdomain.com/server_access_443.log"
      proxy.server              = ( "" => ( ("host" => "127.0.0.1", "port" => 9004) ) )
    }
  }
}

1 Ответ

1 голос
/ 24 марта 2012

Такая классическая ошибка :) Вы ставите = вместо ==

else $HTTP["url"] == "^/v2/*\.json$" {

Я попробовал это, и я получил точную ошибку строки / столбца вместо просто вашего " Работа не удалась ":

2012-03-24 10:26:31: (configfile.c.564) source: /etc/lighttpd/sites/test.fr line: 13 pos: 20 only =~ and == are allowed in the condition 
...