Project

General

Profile

Mod setenv » History » Revision 2

Revision 1 (hoffie, 2006-08-03 16:04) → Revision 2/30 (jan, 2006-08-20 21:54)

{{{ 
 #!rst 
 =========================== 
 Conditional Request Headers 
 =========================== 

 ------------------ 
 Module: mod_setenv 
 ------------------ 

 .. meta:: 
   :keywords: lighttpd, skeleton 
  
 .. contents:: Table of Contents 

 Description 
 =========== 

 The setenv module allows influencing the environment external applications are spawned in and the response headers the server sends to the clients. 

 Automatic Decompression 
 ----------------------- 

 If you have alot text-files compressed with gzip on disk and want that the browser is decompressing them  
 on retrival you can use setenv to inject the Content-Encoding header: :: 

   $HTTP["url"] =~ "(README|ChangeLog|\.txt)\.gz$" { 
     setenv.add-response-header    = ( "Content-Encoding" => "gzip") 
     mimetype.assign = ("" => "text/plain" ) 
   } 


 Options 
 ======= 

 setenv.add-environment 
   adds a value to the process environment that is passed to the external applications 


 setenv.add-response-header 
   adds a header to the HTTP response sent to the client 

 setenv.add-request-header 
   adds a header to the HTTP request that was received from the client 
 }}}