Installing recent versions from Debian Repositories (testing and sid)
This assumes your are using Debian 4.0 (Etch)
Please note: If you are using Debian stable you will need to compile Nginx from source to avoid dependency problems. This is really easy to do and is described here: http://jimmyg.org/2007/12/07/nginx-proxying-to-pylons-with-ssl-on-debian-etch/
Currently the Nginx debian package in the testing respository is 0.5.30, and in sid (unstable) 0.5.33, fixing this instructions for other versions, or repositories should be really easy.
Edit or create the file:
/etc/apt/preferences
To include:
Package: nginx Pin: release a=testing Pin-Priority: 1000
This will make apt track the package nginx from testing, while trying to resolve all its dependencies in stable first, but going to testing if required.
Off course, you will need to add the testing repositories to your /etc/apt/sources.list
deb http://ftp.debian.org/debian/ testing main contrib deb-src http://ftp.debian.org/debian/ testing main contrib
(Those are just a sample repository urls matching my system, yours could be slighly different)
And tell apt to update the package lists with:
apt-get update
Now we are ready to go, just:
apt-get install nginx
Usually this process requires the upgrate to new versions of libc6, libssl and a couple more libraries, that will also require some services (like openssl) to be restarted.
Thanks to José Parella, the maintainer of these packahes for its great work, help and this instructions.
