2. Nginx
Nginx (pronounced "engine-x") is an open source reverse proxy server for
HTTP(S), SMTP, POP3, and IMAP protocols, as well as a load balancer,
HTTP cache, and a web server (origin server).
3. Installation
Installation on Ubuntu
sudo -s
nginx=stable # use nginx=development for latest development version
echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu lucid main" > /etc/apt/sources.list.
d/nginx-$nginx-lucid.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C
apt-get update
apt-get install nginx
4. Configuration
● /etc/nginx
● /etc/nginx/nginx.conf # global config
worker_processes 4; # = CPU Number
worker_connections 65535; # max connections per process
gzip on; # enable gzip
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml
application/xml+rss text/javascript;
8. Upgrade on the Fly
1. ./configure & make
a. nginx -V
2. backup & replace
a. mv nginx nginx.old
b. cp objs/nginx nginx
3. start & quit
a. kill -USR2
b. kill -QUIT
p.s:
1. Nginx平滑升级
2. Nginx Upgrade