Skip to content

Instantly share code, notes, and snippets.

@loopj
Created June 17, 2012 02:04
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save loopj/2943145 to your computer and use it in GitHub Desktop.
Save loopj/2943145 to your computer and use it in GitHub Desktop.
Install Nginx with SPDY support.
#!/bin/sh
NGINX_VERSION=1.3.4
TMP_PATH=/tmp
# Fetch and extract nginx source
cd $TMP_PATH
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
tar xvfz nginx-$NGINX_VERSION.tar.gz
cd nginx-$NGINX_VERSION
# Fetch the SPDY patch and apply it
wget http://nginx.org/patches/spdy/patch.spdy.txt
patch -p0 < patch.spdy.txt
# Configure nginx
./configure \
--prefix=/usr \
--sbin-path=/usr/sbin \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_ssl_module \
--with-http_gzip_static_module
# Build and install nginx
make && sudo make install
# Cleanup
cd $TMP_PATH
rm -r nginx-$NGINX_VERSION
rm nginx-$NGINX_VERSION.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment