This module provides support for generating (or swapping) Etag header for static content in nginx.
Prepare location for core and/or module code:
mkdir ${HOME}/src
cd ${HOME}/src
Pull code by cloning the repositories and/or downloading packages:
# download nginx sources and unpack
curl http://nginx.org/download/nginx-1.4.4.tar.gz | tar xzf -
# download module sources
git clone https://github.com/soutys/nginx-static-etags.git ./nginx-static-etags
Compile module into nginx:
cd ./nginx-1.4.4
# add other options, modules, CFLAGS if you like...
./configure --add-module=${HOME}/src/nginx-static-etags
# multithreaded compilation is also "supported" :)
make -j4
# use root privileges or define your own `--prefix=...` option for `configure` script
sudo make install
That's (almost) all!
Update relevant location
blocks in your nginx.conf
file:
location / {
...
etags on;
etag_hash on|off;
etag_hash_method md5|sha1;
...
}
-
code checks:
cppcheck --verbose --enable=all --inconclusive ${HOME}/src/ngx_http_static_etags_module.c valgrind --verbose --leak-check=full --show-reachable=yes --track-origins=yes /usr/local/nginx/sbin/nginx
-
debugging:
- bring it to feature parity with the Apache configuration option