Skip to content

Commit 67a71a6

Browse files
docs: document HTTP request filtering differences
1 parent ca919b9 commit 67a71a6

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

docs/migrate.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ This guide covers a basic migration for a typical PHP application.
1818
| `php_value` / `php_admin_value` | [`php_ini` Caddyfile directive](config.md#php-config) |
1919
| `pm = static` / `pm.max_children` | `num_threads` |
2020
| `pm = dynamic` | [`max_threads auto`](performance.md#max_threads) |
21+
| Web server request filtering | Caddy routes and matchers |
22+
23+
## HTTP request filtering
24+
25+
When migrating from a stock Nginx or Apache package, check any request filtering that was done by the web server before PHP-FPM received the request.
26+
FrankenPHP is built on Caddy, so valid HTTP methods and headers are passed through Caddy's normal routing unless your `Caddyfile` rejects them first.
27+
28+
For example, some web servers reject `TRACE` requests by default.
29+
If your application should keep that behavior, add an explicit matcher before `php_server`:
30+
31+
```caddyfile
32+
example.com {
33+
@trace method TRACE
34+
respond @trace 405
35+
36+
root /var/www/app/public
37+
php_server
38+
}
39+
```
40+
41+
Apply the same approach to any stricter method or header policy your previous front web server enforced.
2142

2243
## Step 1: replace your web server config
2344

0 commit comments

Comments
 (0)