Setting limits

Restrictions

Preliminaries

This note describes miscellaneous restrictions that can be placed on the server.

Configuration

An optional restrictions section may be defined to limit the server. It may be added to either the host or server section. These are the recognized entries:

The content-length-limit is used by the PUT method to limit the size of the payload. Specify a value in bytes. If a request to upload a file contains a content-length that exceeds this value, the request is denied with a 411 response code and a rw-content-length-limit information header. The default value is 16777216 (16MB).

The server-version entry may be used to prevent the server from including the software version in the server response header. Set this value to either on (the default) or off.

EBNF

SP ::= U+20
CR ::= U+0D
LEFT-CURLY-BRACKET ::= U+7B
RIGHT-CURLY-BRACKET ::= U+7D
content-length-limit ::= 'content-length-limit' SP [1..67108864] CR
server-version ::= 'server-version' SP ('on' | 'off') CR
restrictions-section ::= 'restrictions' SP LEFT-CURLY-BRACKET CR
content-length-limit
server-version
RIGHT-CURLY-BRACKET CR

Cookbook

Example 1: PUT limit
server {
restrictions {
content-length-limit 16777216 // 16MB
}
}
Example 1: Removing the software version from the server response header
server {
restrictions {
server-version off
}
}

Review

Key points to remember:

  • Restrictions are optional and may be omitted if the default values are acceptable.

Setting limits