Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation about request_body directive in Caddyfile #104

Merged
merged 5 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/docs/markdown/caddyfile/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Directive | Description
**[php_fastcgi](/docs/caddyfile/directives/php_fastcgi)** | Serve PHP sites over FastCGI
**[push](/docs/caddyfile/directives/push)** | Push content to the client using HTTP/2 server push
**[redir](/docs/caddyfile/directives/redir)** | Issues an HTTP redirect to the client
**[request_body](/docs/caddyfile/directives/request_body)** | Manipulates request body
**[request_header](/docs/caddyfile/directives/request_header)** | Manipulates request headers
**[respond](/docs/caddyfile/directives/respond)** | Writes a hard-coded response to the client
**[reverse_proxy](/docs/caddyfile/directives/reverse_proxy)** | A powerful and extensible reverse proxy
Expand Down Expand Up @@ -75,6 +76,7 @@ Many directives manipulate the HTTP handler chain. The order in which those dire
root

header
request_body

redir
rewrite
Expand Down
29 changes: 29 additions & 0 deletions src/docs/markdown/caddyfile/directives/request_body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: request_body (Caddyfile directive)
---

# request_body

Manipulates or sets restrictions on the bodies of incoming requests.


## Syntax

```caddy-d
request_body [<matcher>] {
max_size <value>
}
```

- **max_size** is the maximum size in bytes allowed for the request body. It accepts all formats supported by [go-humanize](https://github.com/dustin/go-humanize/blob/master/bytes.go).


## Examples

Limit request body sizes to 10 megabytes:

```caddy-d
request_body {
max_size 10MB
}
```