# Using ModSecurity

[ModSecurity](https://modsecurity.org/) is a popular open source web application firewall that can be used in conjunction with the Apache and Nginx web servers. When leona is configured behind a web server that uses ModSecurity, certain configuration changes must be made.&#x20;

Some distributions (for example RHEL 7.x) ship with older rule sets that do not allow the MIME type **`application/json`** to be used in requests. This can be fixed by modifying the variable **`tx.allowed_request_content_type`**:

```bash
# Allow application/json
SecRule REQUEST_URI "@beginsWith /" \
   "id:'000001', \
   phase:1, \
   t:none, \
setvar:'tx.allowed_request_content_type=application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/x-amf|application/json|application/octet-stream', \
   nolog, \
   pass"
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ciusji.gitbook.io/leona/security/using-modsecurity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
