Skip to content

Commit

Permalink
Add support for HTTP/2 in Nginx
Browse files Browse the repository at this point in the history
This is currently supported by more than 99% of the browsers, while
browsers not supporting it will fall back to HTTP/1.

With HTTP/2, browsers don't have to open more connections in order to
request more files, meaning that the page will load faster, particularly
when the page requires downloading many CSS files, JavaScript files or
images.
  • Loading branch information
javierm committed Apr 19, 2024
1 parent e56b0d7 commit 17a9522
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/nginx/templates/consul_vhost.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ server {

{% if domain is defined %}

listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
listen [::]:443 ssl http2 ipv6only=on;
listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/{{ server_hostname }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ server_hostname }}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
Expand Down

0 comments on commit 17a9522

Please sign in to comment.