summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_proxy_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_proxy_module.c')
-rw-r--r--src/http/modules/ngx_http_proxy_module.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index 9f40c2193..7897b3f4b 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -198,6 +198,9 @@ 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 }
};
@@ -875,6 +878,14 @@ ngx_http_proxy_handler(ngx_http_request_t *r)
ngx_http_proxy_main_conf_t *pmcf;
#endif
+ 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;
}
@@ -888,8 +899,6 @@ ngx_http_proxy_handler(ngx_http_request_t *r)
ngx_http_set_ctx(r, ctx, ngx_http_proxy_module);
- plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module);
-
u = r->upstream;
if (plcf->proxy_lengths == NULL) {