Update documentation

This commit is contained in:
Alexey Berezhok
2026-06-27 00:32:35 +03:00
parent da7c38a0c6
commit 1b37117a09
2 changed files with 118 additions and 22 deletions

View File

@@ -15,6 +15,54 @@ The following directives are available in this module:
| Context | Available Levels |
|----------------|---------------------------------------------|
| `main`, `server`, `location` | ✓ All three levels supported |
| `GlobalLocation` | ✓ Global location level (new) |
**Syntax:**
```nginx
RewriteEngine on|off
```
**Possible Values:**
- `on` - Enable rewrite engine
- `off` - Disable rewrite engine (default)
**Example in nginx.conf:**
```nginx
http {
server {
RewriteEngine on;
location /blog/ {
# Rules apply here
}
location /static/ {
RewriteEngine off; # Disable for this location
}
}
}
```
**GlobalLocation Configuration (new):**
The `GlobalLocationRewriteEngine` directive allows setting the rewrite engine state for server-level locations:
```nginx
http {
server {
GlobalLocationRewriteEngine on;
# All locations in this server inherit the global setting
location /blog/ {
# RewriteEngine is enabled by default
}
location /static/ {
RewriteEngine off; # Override for this location if needed
}
}
}
```
**Syntax:**
```nginx
@@ -395,17 +443,18 @@ RewriteFallBack /handler.php?lang=ru
## Configuration Levels Summary
| Directive | http/main | server | location | .htaccess |
|-----------------|-----------|--------|----------|-----------|
| RewriteEngine | ✓ | ✓ | ✓ | ✓ |
| RewriteRule | - | ✓ | | |
| RewriteCond | - | ✓ | ✓ | ✓ |
| RewriteBase | - | - | ✓ | ✓ |
| RewriteOptions | | | ✓ | - |
| RewriteMap | - | ✓ | - | - |
| HtaccessEnable | | ✓ | - | - |
| HtaccessName | ✓ | ✓ | - | - |
| RewriteFallBack | | | - | |
| Directive | http/main | server | location | .htaccess |
|--------------------------|-----------|--------|----------|-----------|
| RewriteEngine | ✓ | ✓ | ✓ | ✓ |
| GlobalLocationRewriteEngine | - | ✓ | - | - |
| RewriteRule | - | ✓ | ✓ | ✓ |
| RewriteCond | - | | ✓ | ✓ |
| RewriteBase | - | - | ✓ | |
| RewriteOptions | | ✓ | | - |
| RewriteMap | - | ✓ | - | - |
| HtaccessEnable | ✓ | ✓ | - | - |
| HtaccessName | | | - | - |
| RewriteFallBack | ✗ | ✗ | - | ✓ |
---
@@ -458,6 +507,15 @@ The `RewriteFallBack` directive allows customizing the fallback path used when a
---
### GlobalLocationRewriteEngine Directive (new)
The `GlobalLocationRewriteEngine` directive allows setting the rewrite engine state for server-level locations:
1. **Scope:** Configured only at the server block level within http context
2. **Inheritance:** All new locations inherit the global configuration by default
3. **Override Support:** Individual locations can still override the global setting with their own `RewriteEngine` directive
---
## Notes
- Rewrite rules are processed in order as defined in configuration or `.htaccess` files