Install nginx stable 1.4.1 on Debian Squeeze

nginx has some problems and the shipped version in Debian Squeeze is 0.7.67.
I thought it would be a good time to upgrade to the stable version directly from nginx’s repos.

#Start with downloading and installing PGP keys
wget -O key http://nginx.org/keys/nginx_signing.key && sudo apt-key add key && sudo rm -f key

#Add these lines to /etc/apt/sources.list
deb http://nginx.org/packages/debian/ squeeze nginx
deb-src http://nginx.org/packages/debian/ squeeze nginx

#Update apt lists
sudo apt-get update

#Upgrade or install nginx
sudo apt-get upgrade
#or
sudo apt-get install nginx

All done.