> For the complete documentation index, see [llms.txt](https://docs.jentis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jentis.com/key-features/cookie-lifetime-extender/cookie-lifetime-extender-webserver-cdn-configurations/litespeed-configuration-guide.md).

# Litespeed Configuration Guide

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* LiteSpeed Web Server (OpenLiteSpeed or LiteSpeed Enterprise) installed and running
* Admin access to LiteSpeed WebAdmin Console
* A domain configured on a Virtual Host (e.g., litespeed.jtm-demo.com) with DNS pointing to your server

### Step 1: Create an External App (Web Server) <a href="#step-1-create-an-external-app-web-server" id="step-1-create-an-external-app-web-server"></a>

Navigate to your Virtual Host, then open the **External App** tab and add a new Web Server definition with the following settings:

| **Field (Web Server Definition**) | **Example Value**      | **Notes**                                                        |
| --------------------------------- | ---------------------- | ---------------------------------------------------------------- |
| Name                              | hash\_proxy            | Descriptive identifier referenced by rewrite rules               |
| Address                           | <https://hash.url.com> | Full URL of backend (HTTP or HTTPS). Match your upstream scheme. |
| Max Connections                   | 100                    | Range 1–2000. Tune based on backend capacity.                    |
| Connection Keepalive Timeout      | 60                     | Use persistent connections to improve performance; -1 disables.  |
| Initial Request Timeout (secs)    | 60                     | Must be >= 1. Increase for slow upstreams.                       |
| Retry Timeout (secs)              | 1                      | Backoff window before retrying failed connections.               |
| Response Buffering                | No                     | Disable for streaming/low-latency responses.                     |

Optionally set Environment variables and Notes as needed using PROPERTY=VALUE syntax.

If your backend uses HTTPS with a certificate that is self-signed or not publicly trusted, ensure your LiteSpeed build trusts the upstream or use HTTP to the backend within a private network.

### Step 2: Enable and Add Rewrite Rules <a href="#step-2-enable-and-add-rewrite-rules" id="step-2-enable-and-add-rewrite-rules"></a>

Within the same Virtual Host, open the **Rewrite** tab.

1. In Rewrite Control, set Enable Rewrite to Yes. Optionally adjust Log Level.
2. In Rewrite Rules, click Edit and paste the following rules, then Save:
3. Gracefully restart LiteSpeed to apply the changes (Actions > Graceful Restart).

{% hint style="info" %}
Please make sure to replace the values "hash" and "url.com" with your values from the DCP configuration page
{% endhint %}

```
RewriteEngine On 
# The E=proxy-host part forces the correct Host header to the backend 
RewriteRule ^/?hash(/.*)?$ http://hash_proxy/$1 [P,L,QSA,E=proxy-host:hash.url.com]
```

### Result

Requests to /kndmjf on your domain will be proxied to the external app defined as kndmjf\_proxy, preserving query strings and forwarding the correct Host header to the upstream.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.jentis.com/key-features/cookie-lifetime-extender/cookie-lifetime-extender-webserver-cdn-configurations/litespeed-configuration-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
