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