1. Installing Nginx
cd/usr/local/
wget http://nginx.org/download/nginx-1.2.8.tar.gz
TAR-ZXVF nginx-1.2.8.tar.gz
CD nginx-1.2.8
./configure--prefix=/usr/local/nginx
Make
Make install
2. Configure the reference address
http{
Include MIME.Types;
Default_type Application/Octet-Stream;
Sendfile on;
Keepalive_timeout65;
Upstream www.Aaa.Com{
Server124.205.16.69:8090;
}
Upstream www.Bbb.Com{
Server124.205.16.69:8100;
}
Server{
Listen80;
server_nameWww.Aaa.Com;
Location/ {
Index Index.HTML index.Jsp;
Proxy_pass http://Www.aaa.com;
Proxy_set_header X-Real-IP $remote _addr;
Client_max_body_size100m;
}
}
Server{
Listen80;
server_nameWww.Bbb.Com;
Location/ {
Index index. HTML index. JSP;
Proxy_pass http://www.bbb.com;
Proxy_set_header X-Real-IP $remote _addr;
Client_max_body_size 100m;
}
}
}< /c11>
3. Issues to be aware of:
/usr/local/nginx/sbin/nginx-s Reload renamed the overload may not take effect
If the discovery does not take effect, a restart is required.
/usr/local/nginx/sbin/nginx-s stop
/usr/local/nginx/sbin/nginx
As for some of Nginx's common function points and the original rational things will be introduced in the following articles, please look forward to.
A physical machine one IP configuration multiple domain name multi-Set Program method