Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:config:envirnment_variables [2020/08/06 14:36]
Lisa Clarke [wait-req-full-body] Edited
litespeed_wiki:config:envirnment_variables [2023/01/18 19:34] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== Special environment variables in LiteSpeed Rewrite Rules ====== +~~REDIRECT>​https://docs.litespeedtech.com/lsws/configuration/#environment-variables~~
-The following are the Special Environment Variables that can be used in rewrite rules to control features: +
- +
-=====dontlog===== +
-Once set, skips access logging, the value does not matter, for example: +
-  RewriteRule \.gif - [E=dontlog:​1] +
- +
-=====nokeepalive===== +
-Closes the client'​s connection after finishing this request, the value does not matter, for example: +
-  RewriteRule .* - [E=nokeepalive:​1] +
- +
-=====no-gzip===== +
-Do not use gzip compression for this request, must be set to a non-zero value, for example: +
-  RewriteRule \.css - [E=no-gzip:​1] +
-no-gzip:0 has no effect. +
- +
-=====Proxy-Host===== +
-Modify proxy request "​Host"​ header value, for example: +
-A web site's domain name is "​www.example.com",​ it sends a proxy request to the backend, the backend is defined as a web server with name "​node1",​ it requires the domain name to be "​www.example.com",​ the rewrite rule should be +
-  RewriteRule ^(.*)$ http://node1/$1 [P,​E=Proxy-Host:​www.example.com+
- +
-=====cache-ctrl/cache-control===== +
-Modify LSWS page cache policy +
-enable cache +
-  Rewriterule ^/special_cachable_url$ - [E=Cache-ctrl:​max-ages=30] +
-  Rewriterule ^/non-cacheable-url$ - [E=Cache-control:​no-cache] +
- +
-=====No abort===== +
-This flag prevents external app processes from being killed by LSWS as a runaway process while it is in the middle of processing. +
-  RewriteRule ^script_url$ - [E=noabort:​1] +
- +
-===== wait-req-full-body ===== +
- +
-When LSWS processes a request, it usually passes the request to the backend (PHP) without waiting for the full request body to complete. Usually, this is not a problem, but it can be an issue if the script needs the whole request body to work properly. As of v5.4.8 build 4, the ''​wait-req-full-body'' ​environment ​variable allows you to control this. It can be set via SetEnv, SetEnvIf or a rewrite rule. +
- +
-  RewriteRule ^(.*)$ [E=wait-req-full-body:​1] +
- +
-or  +
- +
-  SetEnv wait-req-full-body 1+
  • Admin
  • Last modified: 2020/08/06 14:36
  • by Lisa Clarke