Compile Nginx from source

Probably you are setting a virtual host on one of cloud providers. Read here few references on cloud computing provides

Configure nginx with extra modules

First step in order to obtain needed features you have to think about which modules of nginx you will be using. Read Nginx documentation and download all dependencies.

For example I will download ngx_cache_purge from git and some few others nginx modules
git clone
git clone
git clone

Depending on which modules you will use probably you will need to install some libraries (depending on your operating sistem) as shown below.

apt-get install libxml2-dev
apt-get install libxslt-dev
apt-get install libgd2-xpm libgd2-xpm-dev

You can find the libraries or nginx modules you have to download or install by trying to configure the build. Some parameters may be removed in your case. You cand define each module in the folowing command and point to the source code of the module so build proces can link to it.

./configure --sbin-path=/usr/sbin/nginx --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/ --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --with-openssl=/usr/local/src/openssl-1.0.1j --add-module=/usr/local/src/passenger_apt_automation/debian_specs/nginx/modules/nginx-auth-pam --add-module=/usr/local/src/passenger_apt_automation/debian_specs/nginx/modules/nginx-echo --add-module=/usr/local/src/passenger_apt_automation/debian_specs/nginx/modules/nginx-upstream-fair --add-module=/usr/local/src/passenger_apt_automation/debian_specs/nginx/modules/nginx-dav-ext-module --add-module=/usr/local/src/ngx_cache_purge

The output of this command may be similar with:

Configuration summary
+ using system PCRE library
+ using OpenSSL library: /usr/local/src/openssl-1.0.1j
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
nginx http scgi temporary files: "/var/lib/nginx/scgi"

Build nginx and install

If the configure step was successfully finished then you can try to build and install nginx by following commands.

make install