Project

General

Profile

Actions

Bug #2891

closed

setenv.add-response-header does not work with url.redirect

Added by fory over 6 years ago. Updated over 6 years ago.

Status:
Invalid
Priority:
Normal
Category:
mod_redirect
Target version:
ASK QUESTIONS IN Forums:

Description

Set-Cookie header does not appear with url.redirect. A normal use with dirlisting works fine.

$SERVER["socket"] == ":8888" {
setenv.add-response-header = ( "Set-Cookie" => "Secure" )
url.redirect = (".*" => "https://test.env.fory.com$0")
}

curl -I http://10.0.2.58:8888
HTTP/1.1 301 Moved Permanently
Location: https://test.env.fory.com/
Date: Thu, 14 Jun 2018 00:32:05 GMT
Server: lighttpd/1.4.49

Actions #1

Updated by gstrauss over 6 years ago

  • Status changed from New to Invalid

A simple test works just fine. Did you load the modules in the right order for mod_setenv to apply before mod_redirect generates a response?

server.document-root = "/valid/path/here" 
server.modules = ( "mod_setenv", "mod_redirect" )
$SERVER["socket"] == ":8888" {
  setenv.add-response-header = ( "Set-Cookie" => "Secure" )
  url.redirect = (".*" => "https://test.env.fory.com$0")
}
Actions #2

Updated by fory over 6 years ago

Yes, Like I said, the simple dirlisting works fine. It does not work with url.redirect.

Actions #3

Updated by fory over 6 years ago

That was it. I needed to move "mod_setenv" before "mod_redirect". Thx for the tip.

Actions

Also available in: Atom