enable SPDY by installing nginx 1.6 from the nginx PPA

This commit is contained in:
Joshua Tauberer 2014-11-19 00:55:58 +00:00
parent 3133dcd5a3
commit b5e21daa98
4 changed files with 21 additions and 4 deletions

View File

@ -40,7 +40,7 @@ keepalive_timeout 70;
# Buffer size of 1400 bytes fits in one MTU.
# nginx 1.5.9+ ONLY
#ssl_buffer_size 1400;
ssl_buffer_size 1400;
# SPDY header compression (0 for none, 9 for slow/heavy compression). Preferred is 6.
#

View File

@ -12,7 +12,7 @@ server {
# The secure HTTPS server.
server {
listen 443 ssl;
listen 443 ssl spdy;
server_name $HOSTNAME;

View File

@ -17,11 +17,13 @@ hide_output apt-get -y upgrade
# when generating random numbers for private keys (e.g. during
# ldns-keygen).
# * unattended-upgrades: Apt tool to install security updates automatically.
# * software-properties-common: Provides apt-add-repository.
# * ntp: keeps the system time correct
# * fail2ban: scans log files for repeated failed login attempts and blocks the remote IP at the firewall
apt_install python3 python3-dev python3-pip \
wget curl \
software-properties-common \
haveged unattended-upgrades ntp fail2ban
# Allow apt to install system updates automatically every day.

View File

@ -13,12 +13,27 @@ if [ -f /usr/sbin/apache2 ]; then
hide_output apt-get -y --purge autoremove
fi
# Ubuntu 14.04 comes with nginx 1.4.6, but we want 1.6.x to have SPDY support
# which is the more modern best practice. We'll get nginx from the nginx PPA.
# An update from stock nginx to the nginx ppa causes trouble, so we'll purge
# first.
if nginx -v 2>&1 | grep 1.4; then
apt-get purge -y nginx
fi
# Then add the PPA. Test first so we don't have to run apt-get update if the
# PPA was already present.
if [ ! -f /etc/apt/sources.list.d/nginx-stable-trusty.list ]; then
hide_output add-apt-repository -y ppa:nginx/stable
hide_output apt-get update
fi
# Install nginx and a PHP FastCGI daemon.
#
# Turn off nginx's default website.
apt_install nginx php5-fpm
# Turn off nginx's default website.
rm -f /etc/nginx/sites-enabled/default
# Copy in a nginx configuration file for common and best-practices