Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 2b18bf2

Browse files
committed
Configuration: added some missing proxy settings options.
There are some http related settings that are set internally but not exposed to the config system. Add - proxy_buffer_size - proxy_header_buffer_size - proxy_timeout - proxy_send_timeout - proxy_read_timeout to the http configuration in nxt_router.c and the http configuration validation in nxt_conf_validation.c This doesn't add 'proxy_buffers' as that is unused and will be removed in a follow up commit. This then allows users to set these such as "settings": { "http": { "proxy_buffer_size": 65536, "proxy_header_buffer_size": 8192, "proxy_timeout": 30, "proxy_send_timeout": 60, "proxy_read_timeout": 60 } } If these values aren't set they retain their default values.
1 parent 7c69118 commit 2b18bf2

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/nxt_conf_validation.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,21 @@ static nxt_conf_vldt_object_t nxt_conf_vldt_http_members[] = {
320320
}, {
321321
.name = nxt_string("discard_unsafe_fields"),
322322
.type = NXT_CONF_VLDT_BOOLEAN,
323+
}, {
324+
.name = nxt_string("proxy_buffer_size"),
325+
.type = NXT_CONF_VLDT_INTEGER,
326+
}, {
327+
.name = nxt_string("proxy_header_buffer_size"),
328+
.type = NXT_CONF_VLDT_INTEGER,
329+
}, {
330+
.name = nxt_string("proxy_timeout"),
331+
.type = NXT_CONF_VLDT_INTEGER,
332+
}, {
333+
.name = nxt_string("proxy_send_timeout"),
334+
.type = NXT_CONF_VLDT_INTEGER,
335+
}, {
336+
.name = nxt_string("proxy_read_timeout"),
337+
.type = NXT_CONF_VLDT_INTEGER,
323338
}, {
324339
.name = nxt_string("websocket"),
325340
.type = NXT_CONF_VLDT_OBJECT,

src/nxt_router.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,36 @@ static nxt_conf_map_t nxt_router_http_conf[] = {
14491449
NXT_CONF_MAP_INT8,
14501450
offsetof(nxt_socket_conf_t, discard_unsafe_fields),
14511451
},
1452+
1453+
{
1454+
nxt_string("proxy_buffer_size"),
1455+
NXT_CONF_MAP_SIZE,
1456+
offsetof(nxt_socket_conf_t, proxy_buffer_size),
1457+
},
1458+
1459+
{
1460+
nxt_string("proxy_header_buffer_size"),
1461+
NXT_CONF_MAP_SIZE,
1462+
offsetof(nxt_socket_conf_t, proxy_header_buffer_size),
1463+
},
1464+
1465+
{
1466+
nxt_string("proxy_timeout"),
1467+
NXT_CONF_MAP_MSEC,
1468+
offsetof(nxt_socket_conf_t, proxy_timeout),
1469+
},
1470+
1471+
{
1472+
nxt_string("proxy_send_timeout"),
1473+
NXT_CONF_MAP_MSEC,
1474+
offsetof(nxt_socket_conf_t, proxy_send_timeout),
1475+
},
1476+
1477+
{
1478+
nxt_string("proxy_read_timeout"),
1479+
NXT_CONF_MAP_MSEC,
1480+
offsetof(nxt_socket_conf_t, proxy_read_timeout),
1481+
},
14521482
};
14531483

14541484

0 commit comments

Comments
 (0)