Project

General

Profile

Actions

Bug #2794

closed

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

Added by carpii over 7 years ago. Updated over 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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

Actions #1

Updated by gstrauss over 7 years ago

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

Updated by gstrauss over 7 years ago

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

Also available in: Atom