Skip to content

Instantly share code, notes, and snippets.

@seanhandley
Last active October 18, 2015 08:41
Show Gist options
  • Save seanhandley/c5934e289b5e525043d6 to your computer and use it in GitHub Desktop.
Save seanhandley/c5934e289b5e525043d6 to your computer and use it in GitHub Desktop.
Enable HTTP2 in NginX on Ubuntu
# ...
deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx
# Where 'trusty' is the Ubuntu release codename (see `cat /etc/lsb-release`)
Upgrade NginX to support HTTP2 on Ubuntu
# As root/sudo
# Add the nginx entries to the source list (see sources.list)
# Add the nginx signing key
curl http://nginx.org/packages/keys/nginx_signing.key | apt-key add -
# Update apt
apt-get update
# Back up your nginx config files
cp -r /etc/nginx .
# You need to fully remove nginx if it's already installed
apt-get purge nginx nginx-common
# Install latest stable NginX (with experimental http2 support)
apt-get install nginx
# Move your NginX config back
cp -r nginx/* /etc/nginx/
# Enable http2 (see nginx.conf)
# Restart NginX
service nginx restart
# ...
server {
# ...
listen 443 ssl http2;
# ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment