Proxy: do not require HTTP/2 module.

This commit is contained in:
Sergey Kandaurov 2025-12-12 18:11:59 +04:00
parent d796f457c4
commit c1eac3f526
3 changed files with 10 additions and 18 deletions

View File

@ -102,7 +102,7 @@ if [ $HTTP = YES ]; then
fi
if [ $HTTP_V2 = YES ]; then
if [ $HTTP_V2 = YES -o $HTTP_PROXY = YES ]; then
have=NGX_HTTP_V2_SUPPORT . auto/have
USE_HTTP_V2=YES
@ -741,6 +741,15 @@ if [ $HTTP = YES ]; then
ngx_module_link=$HTTP_PROXY
. auto/module
ngx_module_name=ngx_http_proxy_v2_module
ngx_module_incs=
ngx_module_deps=
ngx_module_srcs=src/http/modules/ngx_http_proxy_v2_module.c
ngx_module_libs=
ngx_module_link=$HTTP_PROXY
. auto/module
fi
if [ $HTTP_FASTCGI = YES ]; then
@ -787,17 +796,6 @@ if [ $HTTP = YES ]; then
. auto/module
fi
if [ $HTTP_PROXY = YES -a $HTTP_V2 = YES ]; then
ngx_module_name=ngx_http_proxy_v2_module
ngx_module_incs=
ngx_module_deps=
ngx_module_srcs=src/http/modules/ngx_http_proxy_v2_module.c
ngx_module_libs=
ngx_module_link=$HTTP_V2
. auto/module
fi
if [ $HTTP_PERL != NO ]; then
ngx_module_name=ngx_http_perl_module
ngx_module_incs=src/http/modules/perl

View File

@ -198,9 +198,7 @@ static ngx_conf_post_t ngx_http_proxy_ssl_conf_command_post =
static ngx_conf_enum_t ngx_http_proxy_http_version[] = {
{ ngx_string("1.0"), NGX_HTTP_VERSION_10 },
{ ngx_string("1.1"), NGX_HTTP_VERSION_11 },
#if (NGX_HTTP_V2)
{ ngx_string("2"), NGX_HTTP_VERSION_20 },
#endif
{ ngx_null_string, 0 }
};
@ -880,11 +878,9 @@ ngx_http_proxy_handler(ngx_http_request_t *r)
plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module);
#if (NGX_HTTP_V2)
if (plcf->http_version == NGX_HTTP_VERSION_20) {
return ngx_http_proxy_v2_handler(r);
}
#endif
if (ngx_http_upstream_create(r) != NGX_OK) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;

View File

@ -116,9 +116,7 @@ ngx_int_t ngx_http_proxy_rewrite_redirect(ngx_http_request_t *r,
ngx_int_t ngx_http_proxy_rewrite_cookie(ngx_http_request_t *r,
ngx_table_elt_t *h);
#if (NGX_HTTP_V2)
ngx_int_t ngx_http_proxy_v2_handler(ngx_http_request_t *r);
#endif
extern ngx_module_t ngx_http_proxy_module;