Nginx Virtual Host + load Balancer

Source: Internet
Author: User

Worker_processes 2;

Events {

Worker_connections 1024;

}

HTTP {

Include Mime.types;

Default_type Application/octet-stream;

Sendfile on;

Keepalive_timeout 65;

#nginx vhosts Config

Upstream REST_LC {

#ip_hash;

Server 192.168.1.240:8080;

Server 192.168.1.244:8080;

#sticky name=srv_id expires=1h domain=www.lc.com path=/;

}

Upstream WAP_LC {

#ip_hash;

Server 192.168.1.240:8081;

Server 192.168.1.244:8081;

#sticky name=srv_id expires=1h domain=www.lc.com path=/;

}

Upstream ACTIVITY_LC {

#ip_hash;

Server 192.168.1.244:8082;

Server 192.168.1.240:8082;

#sticky name=srv_id expires=1h domain=www.lc.com path=/;

}

server{

server_name rest.lc.in;

Listen 80;

Location/{

Root/home/tomcat/tomcat-rest;

Proxy_pass HTTP://REST_LC;

Proxy_set_header Host $host;

Proxy_set_header x-forwarded-for $remote _addr;

}

}

server{

Listen 80;

server_name wap.lc.in;

Location/{

Root/home/tomcat/tomcat-wap;

Proxy_pass HTTP://WAP_LC;

Proxy_set_header Host $host;

Proxy_set_header x-forwarded-for $remote _addr;

}

}

server{

Listen 80;

server_name activity.lc.in;

Location/{

root/home/tomcat/tomcat-activity;

Proxy_pass HTTP://ACTIVITY_LC;

Proxy_set_header Host $host;

Proxy_set_header x-forwarded-for $remote _addr;

}


}

}


Nginx Virtual Host + load Balancer

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.