Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
litespeed_wiki:config:special-rewrite-rule-directive [2018/05/21 22:33] qtwrk created |
litespeed_wiki:config:special-rewrite-rule-directive [2018/05/25 16:05] (current) Lisa Clarke [No Connection Timeout] Proofreading |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | There are some LiteSpeed WebSever special directive in rewrite rules. | + | ======Special Rewrite Rule Directives====== |
- | If you are using LiteSpeed over Apache environment, please make sure the following directive(s) included by | + | LiteSpeed Web Server understands several special directives that can be added to rewrite rules. |
+ | |||
+ | If you are using LiteSpeed in an Apache environment, please make sure the following directive(s) are included in this format: | ||
<IfModule litespeed> | <IfModule litespeed> | ||
Line 7: | Line 9: | ||
</IfModule> | </IfModule> | ||
| | ||
- | So it won't be processed by Apache in case switched to it. | + | This ensures that the directives won't be processed by Apache if you switch to it. |
- | **Don't log:** | + | =====Don't log===== |
- | Once set, skips access logging, the value does not matter, for example: | + | Once set, this directive skips access logging. The value does not matter. For example: |
RewriteRule \.gif - [E=dontlog:1] | RewriteRule \.gif - [E=dontlog:1] | ||
+ | =====No Keepalive===== | ||
- | **No Keepalive:** | + | Closes the client's connection after finishing the current request. The value does not matter. For example: |
- | + | ||
- | Closes the client's connection after finishing this request, the value does not matter, for example: | + | |
RewriteRule .* - [E=nokeepalive:1] | RewriteRule .* - [E=nokeepalive:1] | ||
+ | | ||
+ | =====No Gzip===== | ||
- | **No Gzip:** | + | Do not use gzip compression for this request. Must be set to a non-zero value. For example: |
- | + | ||
- | Do not use gzip compression for this request, must be set to a non-zero value, for example: | + | |
RewriteRule \.css - [E=no-gzip:1] | RewriteRule \.css - [E=no-gzip:1] | ||
- | do not set to 0, it has no effect. | + | Do not set to ''0''. It has no effect. |
+ | =====Proxy Host===== | ||
- | **Proxy Host:** | + | Modify proxy request "Host" header value. For example: |
- | Modify proxy request "Host" header value, for example: | + | A web site's domain name is "<nowiki>www.example.com</nowiki>." It sends a proxy request to the backend, which is defined as a web server with name "node1." It requires the domain name to be "www.example.com," so the rewrite rule should be |
- | + | ||
- | 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] | RewriteRule ^(.*)$ http://node1/$1 [P,E=Proxy-Host:www.example.com] | ||
+ | =====Cache Control===== | ||
- | **Cache Control:** | + | Modify LSWS page cache policy or enable cache. For example: |
- | + | ||
- | Modify LSWS page cache policy | + | |
- | + | ||
- | enable cache | + | |
Rewriterule ^/special_cachable_url$ - [E=Cache-ctrl:max-ages=30] | Rewriterule ^/special_cachable_url$ - [E=Cache-ctrl:max-ages=30] | ||
Line 50: | Line 47: | ||
Rewriterule ^/non-cacheable-url$ - [E=Cache-control:no-cache] | Rewriterule ^/non-cacheable-url$ - [E=Cache-control:no-cache] | ||
+ | =====No Abort===== | ||
- | **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. This is useful when executing long-running PHP applications. |
- | + | ||
- | This flag prevents external app processes from being killed by LSWS as a runaway process while it is in the middle of processing, this is useful when running long-time PHP application. | + | |
RewriteRule ^script_url$ - [E=noabort:1] | RewriteRule ^script_url$ - [E=noabort:1] | ||
+ | | ||
+ | =====No Connection Timeout===== | ||
+ | Keeps the connection between server and client from timing out. | ||
- | **[[litespeed_wiki:config:xmlrpc.php_bot_attack_block|Block Bot]]:** | + | RewriteRule ^script_url$ - [E=noconntimeout:1] |
- | This is drop connection and useful when set up against DDoS attack. | + | |
+ | =====Block Bot===== | ||
+ | |||
+ | This drops connection, and is useful when set up against DDoS attack. [[litespeed_wiki:config:xmlrpc.php_bot_attack_block|Learn more]]. For example: | ||
RewriteRule .* - [E=blockbot:1] | RewriteRule .* - [E=blockbot:1] | ||
+ | | ||
+ | | ||
+ | |||