aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2023-02-27 14:00:56 +0400
committerRoman Arutyunyan <arut@nginx.com>2023-02-27 14:00:56 +0400
commit815ef96124176baef4e940c4beaec158305b368a (patch)
treeef62d1240eae60059e678eb5801caeffa8f14bba /src/http/ngx_http_core_module.c
parenta36ebf7e95baebf445b0973bd270bc009b0b0e9a (diff)
downloadnginx-815ef96124176baef4e940c4beaec158305b368a.tar.gz
nginx-815ef96124176baef4e940c4beaec158305b368a.zip
HTTP/3: "quic" parameter of "listen" directive.
Now "listen" directve has a new "quic" parameter which enables QUIC protocol for the address. Further, to enable HTTP/3, a new directive "http3" is introduced. The hq-interop protocol is enabled by "http3_hq" as before. Now application protocol is chosen by ALPN. Previously used "http3" parameter of "listen" is deprecated.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 21966e698..f22d3bdab 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -4191,6 +4191,10 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strcmp(value[n].data, "http3") == 0) {
#if (NGX_HTTP_V3)
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "the \"http3\" parameter is deprecated, "
+ "use \"quic\" parameter instead");
+ lsopt.quic = 1;
lsopt.http3 = 1;
lsopt.type = SOCK_DGRAM;
continue;
@@ -4202,6 +4206,19 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
#endif
}
+ if (ngx_strcmp(value[n].data, "quic") == 0) {
+#if (NGX_HTTP_V3)
+ lsopt.quic = 1;
+ lsopt.type = SOCK_DGRAM;
+ continue;
+#else
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "the \"quic\" parameter requires "
+ "ngx_http_v3_module");
+ return NGX_CONF_ERROR;
+#endif
+ }
+
if (ngx_strncmp(value[n].data, "so_keepalive=", 13) == 0) {
if (ngx_strcmp(&value[n].data[13], "on") == 0) {
@@ -4304,8 +4321,8 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
#if (NGX_HTTP_SSL && NGX_HTTP_V3)
- if (lsopt.ssl && lsopt.http3) {
- return "\"ssl\" parameter is incompatible with \"http3\"";
+ if (lsopt.ssl && lsopt.quic) {
+ return "\"ssl\" parameter is incompatible with \"quic\"";
}
#endif