开发者

using variable in string in Lighttpd

开发者 https://www.devze.com 2023-01-03 17:11 出处:网络
Hi I\'m trying to do this: $HTTP[\"url\"] =~ \"/(开发者_StackOverflow中文版[^/?]+)$\" { setenv.add-response-header = (

Hi I'm trying to do this:

 $HTTP["url"] =~ "/(开发者_StackOverflow中文版[^/?]+)$" {
    setenv.add-response-header = (
    "Content-Disposition" => "attachment; filename=$1"
    )
 }

but it did not replace $1 with what stored in the regex but just $1 characters.

I'm wondering if something like this is possible in lighttpd.

It seems like the search/replace with regex only works in those redirect syntaxes.


I've found the answer. It has to be done through mod_magnet which binds LUA scripting over lighttpd config.

0

精彩评论

暂无评论...
验证码 换一张
取 消