Last active
October 18, 2015 08:41
-
-
Save seanhandley/c5934e289b5e525043d6 to your computer and use it in GitHub Desktop.
Enable HTTP2 in NginX on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
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`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
server { | |
# ... | |
listen 443 ssl http2; | |
# ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment