Project

General

Profile

Bug #2794

1.4.40 regression: regexp subst vars mangled by config-glue condition caching

Added by carpii 9 months ago. Updated 9 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
2017-02-23
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:

Description

When lighttpd is accessed through a reverse proxy (such as haproxy), mod_extforward is required to allow lighttpd to pick up the X-Forwarded-Prot header.

But in doing so, it corrupts the reg expression vars in some config rules...

Basic Lighty config

server.modules              = (
        "mod_expire",
        "mod_rewrite",
        "mod_redirect",
        "mod_access",
        "mod_auth",
        "mod_setenv",
        "mod_fastcgi",
        "mod_status",
        "mod_compress",
        "mod_magnet",
        "mod_accesslog",
        "mod_extforward" )

extforward.headers = ("X-Forwarded-For")
extforward.forwarder = ("127.0.0.1" => "trust")

$HTTP["scheme"] == "http" {
    $HTTP["host"] =~ ".+" {
        url.redirect = (".*" => "https://%0$0/foo1")
    }
}

Curl shows the redirect response is missing %0 and $0 vars..

$ curl -v http://msolo.domain.local/bar
*   Trying 192.168.1.79...
* TCP_NODELAY set
* Connected to 192.168.1.79 (192.168.1.79) port 80 (#0)
> GET /bar HTTP/1.1
> Host: msolo.domain.local
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Location: https:///bar/foo1
< Content-Length: 0
< Date: Thu, 23 Feb 2017 12:38:54 GMT
< Server: lighttpd

Full discussion at https://redmine.lighttpd.net/boards/2/topics/7076

Associated revisions

Revision 350d39b4 (diff)
Added by gstrauss 9 months ago

[core] fix regex condition subst w/ mod_extforward (fixes #2794)

x-ref:
"1.4.40 regression: regexp subst vars mangled by config-glue condition caching"
https://redmine.lighttpd.net/issues/2794

History

#1

Updated by gstrauss 9 months ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.x to 1.4.46
#2

Updated by gstrauss 9 months ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom