Skip to content

Commit e939ff2

Browse files
committed
Use new http2 directive for Nginx versions >= 1.25.0
1 parent 0c43c06 commit e939ff2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

server/conf/nginx_vhost.conf.master

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ server {
1717
listen [::]:<tmpl_var name='http_port'>;
1818
</tmpl_if>
1919
<tmpl_if name='ssl_enabled'>
20+
<tmpl_if name='http2_directive_compat_quirk' op='==' value='y'>
21+
listen <tmpl_var name='ip_address'>:<tmpl_var name='https_port'> ssl;
22+
http2 on;
23+
<tmpl_else>
2024
listen <tmpl_var name='ip_address'>:<tmpl_var name='https_port'> ssl http2;
25+
</tmpl_if>
2126
<tmpl_if name='use_proxy_protocol' op='==' value='y'>
2227
<tmpl_if name='proxy_protocol_https' op='>' value='0'>
2328
listen <tmpl_var name='ip_address'>:<tmpl_var name='proxy_protocol_https'> ssl http2 proxy_protocol;

server/plugins-available/nginx_plugin.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,12 @@ function update($event_name, $data) {
16221622
$vhost_data['tls13_supported'] = "y";
16231623
}
16241624

1625+
// Nginx >= 1.25.0 uses a dedicated directive to enable HTTP/2 support
1626+
if(version_compare($app->system->getnginxversion(true), '1.25.0', '>=')) {
1627+
$vhost_data['http2_directive_compat_quirk'] = "y";
1628+
1629+
}
1630+
16251631
$tpl->setVar($vhost_data);
16261632

16271633
$server_alias = array();

0 commit comments

Comments
 (0)