Getting Started With SPDY on Nginx

SPDY is a fancy new way to do HTTP, pioneered by Google. Pretty much all modern browsers support it now, except for of course, IE.

If you have SSL enabled and are using nginx, they you are pretty close to running your sites with SPDY. What how easy it is!

Step 1: Get a version of nginx with spdy enabled.


Get some packages. The Ubuntu packages have “–with-http_spdy_module” compiled, so you can install them with no problem:

cd /tmp
apt-key add nginx_signing.key
rm nginx_signing.key

echo "deb precise nginx
deb-src precise nginx" > /etc/apt/sources.list.d/nginx.list
apt-get update
apt-get remove nginx
apt-get autoremove
apt-get install nginx

Centos / RHEL

The Centos packages need to be rebuilt. And you need a new openssl. (carefully)

yum install yum-utils rpmdevtools
yum-builddep nginx
rpm -iĀ

cd /tmp
tar xzf openssl-1.0.1e.tar.gz

Now add these lines to the two configure commands (one normal, one debug) in the spec file (~/rpmbuild/SPECS/nginx.spec):

 --with-http_spdy_module \
 --with-openssl=/tmp/openssl-1.0.1e/ \

Now build yourself and RPM:

cd ~/rpmbuild/
rpmbuild -ba SPECS/nginx.spec
rpm -e nginx
rpm -Uvh RPMS/i386/nginx-1.4.1-1.el6.ngx.i386.rpm
/etc/init.d/nginx restart

Ā ConfiguringĀ nginx

Take your listen line, and add “ssl spdy” to it:

server {
      listen 443 ssl spdy;


Try this SPDY testing page. And try a Chrome plugin that will visually indicate if the server you are talking to supports SPDY.

spdy indicator

Comment via email