mirror of
https://github.com/nginx/nginx.git
synced 2026-05-13 09:36:42 +00:00
Core: reject PROXY protocol v1 for UDP connections.
PROXY protocol version 1 is undefined for UDP. If proxy_protocol_version is left at the default (1) on a UDP stream server, emit an error and fail the connection rather than writing a meaningless v1 header. Users must set proxy_protocol_version 2.
This commit is contained in:
parent
a3799b0bfa
commit
4599b51b57
1 changed files with 7 additions and 0 deletions
|
|
@ -772,6 +772,13 @@ ngx_proxy_protocol_write_conf(ngx_connection_t *c,
|
|||
ngx_array_t *tlvs;
|
||||
|
||||
if (conf->version != 2) {
|
||||
if (c->type == SOCK_DGRAM) {
|
||||
ngx_log_error(NGX_LOG_ERR, c->log, 0,
|
||||
"PROXY protocol version 1 is not supported "
|
||||
"for UDP, use \"proxy_protocol_version 2\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buf = ngx_pnalloc(c->pool, NGX_PROXY_PROTOCOL_V1_MAX_HEADER);
|
||||
if (buf == NULL) {
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue