x64Architecture

Compile Nginx With SPDY

Prerequisites:

  • Nginx >= 1.3.15

Compiling Nginx:

$ wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
$ tar xzvf openssl-1.0.1e.tar.gz && rm -rf openssl-1.0.1e.tar.gz
$ wget get ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre//pcre-8.32.tar.gz
$ tar xzvf pcre-8.32.tar.gz && rm -rf pcre-8.32.tar.gz
$ wget http://nginx.org/download/nginx-1.3.15.tar.gz
$ tar xzvf nginx-1.3.15.tar.gz && rm -rf nginx-1.3.15.tar.gz && cd nginx-1.3.15
$ ./configure --with-openssl=../openssl-1.0.1e --with-http_ssl_module --with-http_spdy_module
--with-pcre=../pcre-8.32
$ make && make install

To enable SPDY in a nginx configuration, just add the “spdy” and the “ssl” parameters to the listen directive:

server {
    listen 443 ssl spdy;
    server_name example.com;
...
}