condition.conf 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. debug.log-request-handling = "enable"
  2. debug.log-condition-handling = "enable"
  3. server.systemd-socket-activation = "enable"
  4. # optional bind spec override, e.g. for platforms without socket activation
  5. include env.SRCDIR + "/tmp/bind*.conf"
  6. server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  7. server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
  8. server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
  9. server.name = "www.example.org"
  10. server.tag = "lighttpd-1.4.x"
  11. server.compat-module-load = "disable"
  12. server.modules = (
  13. "mod_redirect",
  14. "mod_accesslog",
  15. "mod_staticfile",
  16. )
  17. accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
  18. mimetype.assign = (
  19. ".html" => "text/html",
  20. )
  21. url.redirect = (
  22. "^" => "/default",
  23. )
  24. $HTTP["host"] == "www.example.org" {
  25. server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  26. server.name = "www.example.org"
  27. url.redirect = (
  28. "^" => "/match_1",
  29. )
  30. }
  31. else $HTTP["host"] == "test1.example.org" {
  32. server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  33. server.name = "test1.example.org"
  34. url.redirect = (
  35. "^" => "/match_2",
  36. )
  37. }
  38. # comments
  39. else $HTTP["host"] == "test2.example.org" {
  40. server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  41. server.name = "test2.example.org"
  42. url.redirect = (
  43. "^" => "/match_3",
  44. )
  45. }
  46. # comments
  47. else $HTTP["host"] == "test3.example.org" {
  48. server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  49. server.name = "test3.example.org"
  50. url.redirect = (
  51. "^" => "/match_4",
  52. )
  53. # comments
  54. $HTTP["url"] == "/index.html" {
  55. url.redirect = (
  56. "^" => "/match_5",
  57. )
  58. }
  59. }
  60. else $HTTP["host"] == "test4.example.org" {
  61. server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  62. server.name = "test4.example.org"
  63. url.redirect = (
  64. "^" => "/match_6",
  65. )
  66. $HTTP["url"] =~ "^/subdir/" {
  67. url.redirect = (
  68. "^" => "/match_7",
  69. )
  70. }
  71. }
  72. else $HTTP["host"] == "test.example.org" {
  73. server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
  74. server.name = "test.example.org"
  75. var.myvar = "good"
  76. var.one = 1
  77. include "var-include-sub.conf"
  78. }
  79. $HTTP["url"] != "/show/other/server-tag" {
  80. }
  81. else $HTTP["scheme"] == "http" {
  82. server.tag = "special tag"
  83. }