I'm running lighttpd 1.4.33, which is reverse proxied to from an Apache server that is open to the Internet. When accessing a script from the local address of the lighttpd server, GET parameters are passed to the script just fine, and I get the expected result. However, when the script is accessed through the proxy (and is rewritten by the following lighttpd rule), the query parameters seem to be dropped completely.
The rewrite rule that seems to be causing the problem:
$HTTP["host"] =~ "^site\.example\.com$" {
# This affects the requests that aren't rewritten below, ie. static stuff
server.document-root = "/var/www/example/public"
url.rewrite-once = ( "^((?!assets).)*$" => "index.php/$1" )
}
Which is supposed to rewrite all URLs so they are passed through the routing engine in index.php, except the static stuff in the /assets
directory, which should just be served statically. Note that /assets
is a subdir of /var/www/example/public
, so this works correctly.
Lighttpd debug log for the request with the dropped parameter:
2014-07-23 11:36:46: (response.c.310) Request-URI : /foo/bar?someparam=data
2014-07-23 11:36:46: (response.c.311) URI-scheme : http
2014-07-23 11:36:46: (response.c.312) URI-authority: site.example.com
2014-07-23 11:36:46: (response.c.313) URI-path : /foo/bar
2014-07-23 11:36:46: (response.c.314) URI-query : someparam=data
2014-07-23 11:36:46: (response.c.309) -- splitting Request-URI
2014-07-23 11:36:46: (response.c.310) Request-URI : index.php/a
2014-07-23 11:36:46: (response.c.311) URI-scheme : http
2014-07-23 11:36:46: (response.c.312) URI-authority: site.example.com
2014-07-23 11:36:46: (response.c.313) URI-path : index.php/a
2014-07-23 11:36:46: (response.c.314) URI-query :
Note the blank URI-query
field on the last line. It seems as though the step "splitting the request URI" is breaking everything.
Any ideas on what could be causing this?