Advertisement
alevinetx

lighttpd simple regex routing

May 3rd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. My config looks nearly identical to the "working config" listed at the bottom of: https://redmine.lighttpd.net/boards/2/topics/8321
  2.  
  3. Yet, it's not proxying as it should.
  4.  
  5. ]$ lighttpd -v
  6. lighttpd/1.4.53 (ssl) - a light and fast webserver
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. ==========================================
  14. ==== START CONFIG
  15. ==========================================
  16.  
  17. debug.log-request-handling = "enable"
  18. debug.log-condition-handling = "enable"
  19.  
  20. proxy.debug = 1
  21. server.document-root = "/var/whatever"
  22. server.port = 7890
  23. server.username = "nobody"
  24. server.groupname = "nobody"
  25. server.modules = (
  26. "mod_alias",
  27. "mod_redirect",
  28. "mod_proxy",
  29. "mod_rewrite"
  30. )
  31.  
  32.  
  33. default.proxy.server.host = "127.0.0.1"
  34.  
  35.  
  36. $HTTP["url"] =~ "^/redir-xyz/(.*)" {
  37. url.rewrite-once = ( "^/redir-xyz/(.*)" => "/$1" )
  38. proxy.server = ( "" =>
  39. ( "redir for xyz" =>
  40. (
  41. "host" => default.proxy.server.host,
  42. "port" => "16201",
  43. )
  44. )
  45. )
  46. }
  47.  
  48.  
  49. ==========================================
  50. === END CONFIG
  51. ==========================================
  52.  
  53.  
  54. ==========================================
  55. ==== START EXECUTION
  56. ==========================================
  57.  
  58. $ wget my.server.com:7890/redir-xyz/abc?123
  59. --2019-05-03 13:29:28-- http://my.server.com:7890/redir-xyz/abc?123
  60. Resolving my.server.com (my.server.com)... 1.2.3.4
  61. Connecting to my.server.com (my.server.com)|1.2.3.4|:7890... connected.
  62. HTTP request sent, awaiting response... 404 Not Found
  63. 2019-05-03 13:29:28 ERROR 404: Not Found.
  64.  
  65.  
  66. ==========================================
  67. ==== END EXECUTION
  68. ==========================================
  69.  
  70. ==========================================
  71. ==== START LOG
  72. ==========================================
  73. $ lighttpd -D -f simple.conf
  74. 2019-05-03 13:29:12: (server.c.1464) server started (lighttpd/1.4.53)
  75. 2019-05-03 13:29:12: (server.c.1493) WARNING: unknown config-key: default.proxy.server.host (ignored)
  76. 2019-05-03 13:29:19: (response.c.298) run condition
  77. 2019-05-03 13:29:19: (configfile-glue.c.581) === start of condition block ===
  78. 2019-05-03 13:29:19: (configfile-glue.c.449) HTTP["url"] ( /redir-xyz/abc ) compare to ^/redir-xyz/(.*)
  79. 2019-05-03 13:29:19: (configfile-glue.c.493) 1 (uncached) result: true
  80. 2019-05-03 13:29:19: (response.c.429) -- splitting Request-URI
  81. 2019-05-03 13:29:19: (response.c.430) Request-URI : /redir-xyz/abc?123
  82. 2019-05-03 13:29:19: (response.c.431) URI-scheme : http
  83. 2019-05-03 13:29:19: (response.c.432) URI-authority : my.server.com:7890
  84. 2019-05-03 13:29:19: (response.c.433) URI-path (raw) : /redir-xyz/abc
  85. 2019-05-03 13:29:19: (response.c.434) URI-path (clean): /redir-xyz/abc
  86. 2019-05-03 13:29:19: (response.c.435) URI-query : 123
  87. 2019-05-03 13:29:19: (configfile-glue.c.581) === start of condition block ===
  88. 2019-05-03 13:29:19: (configfile-glue.c.500) 1 (cached) result: true
  89. 2019-05-03 13:29:19: (response.c.298) run condition
  90. 2019-05-03 13:29:19: (configfile-glue.c.581) === start of condition block ===
  91. 2019-05-03 13:29:19: (configfile-glue.c.449) HTTP["url"] ( /abc ) compare to ^/redir-xyz/(.*)
  92. 2019-05-03 13:29:19: (configfile-glue.c.493) 1 (uncached) result: false
  93. 2019-05-03 13:29:19: (response.c.429) -- splitting Request-URI
  94. 2019-05-03 13:29:19: (response.c.430) Request-URI : /abc?123
  95. 2019-05-03 13:29:19: (response.c.431) URI-scheme : http
  96. 2019-05-03 13:29:19: (response.c.432) URI-authority : my.server.com:7890
  97. 2019-05-03 13:29:19: (response.c.433) URI-path (raw) : /abc
  98. 2019-05-03 13:29:19: (response.c.434) URI-path (clean): /abc
  99. 2019-05-03 13:29:19: (response.c.435) URI-query : 123
  100. 2019-05-03 13:29:19: (configfile-glue.c.581) === start of condition block ===
  101. 2019-05-03 13:29:19: (configfile-glue.c.500) 1 (cached) result: false
  102. 2019-05-03 13:29:19: (configfile-glue.c.581) === start of condition block ===
  103. 2019-05-03 13:29:19: (configfile-glue.c.500) 1 (cached) result: false
  104. 2019-05-03 13:29:19: (configfile-glue.c.581) === start of condition block ===
  105. 2019-05-03 13:29:19: (configfile-glue.c.500) 1 (cached) result: false
  106. 2019-05-03 13:29:19: (response.c.580) -- before doc_root
  107. 2019-05-03 13:29:19: (response.c.581) Doc-Root : /var/whatever
  108. 2019-05-03 13:29:19: (response.c.582) Rel-Path : /abc
  109. 2019-05-03 13:29:19: (response.c.583) Path :
  110. 2019-05-03 13:29:19: (response.c.625) -- after doc_root
  111. 2019-05-03 13:29:19: (response.c.626) Doc-Root : /var/whatever
  112. 2019-05-03 13:29:19: (response.c.627) Rel-Path : /abc
  113. 2019-05-03 13:29:19: (response.c.628) Path : /var/whatever/abc
  114. 2019-05-03 13:29:19: (configfile-glue.c.581) === start of condition block ===
  115. 2019-05-03 13:29:19: (configfile-glue.c.500) 1 (cached) result: false
  116. 2019-05-03 13:29:19: (configfile-glue.c.581) === start of condition block ===
  117. 2019-05-03 13:29:19: (configfile-glue.c.500) 1 (cached) result: false
  118. 2019-05-03 13:29:19: (response.c.652) -- logical -> physical
  119. 2019-05-03 13:29:19: (response.c.653) Doc-Root : /var/whatever
  120. 2019-05-03 13:29:19: (response.c.654) Basedir : /var/whatever
  121. 2019-05-03 13:29:19: (response.c.655) Rel-Path : /abc
  122. 2019-05-03 13:29:19: (response.c.656) Path : /var/whatever/abc
  123. 2019-05-03 13:29:19: (response.c.668) -- handling physical path
  124. 2019-05-03 13:29:19: (response.c.669) Path : /var/whatever/abc
  125. 2019-05-03 13:29:19: (response.c.144) -- file not found
  126. 2019-05-03 13:29:19: (response.c.145) Path : /var/whatever/abc
  127.  
  128.  
  129.  
  130. ==========================================
  131. ==== ENDLOG
  132. ==========================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement