A physical machine one IP configuration multiple domain name multi-Set Program method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.