http{
upstream sampleapp {
server <<dns entry or IP Address(optional with port)>>;
server <<another dns entry or IP Address(optional with port)>>;
}
....
server{
listen 80;
...
location / {
proxy_pass http://sampleapp;
}
}
http{
upstream sampleapp {
least_conn;
server <<dns entry or IP Address(optional with port)>>;
server <<another dns entry or IP Address(optional with port)>>;
}
....
server{
listen 80;
...
location / {
proxy_pass http://sampleapp;
}
}
http{
upstream sampleapp {
ip_hash;
server <<dns entry or IP Address(optional with port)>>;
server <<another dns entry or IP Address(optional with port)>>;
}
....
server{
listen 80;
...
location / {
proxy_pass http://sampleapp;
}
}
http{
upstream sampleapp {
server <<dns entry or IP Address(optional with port)>> weight=2;
server <<another dns entry or IP Address(optional with port)>>;
}
....
server{
listen 80;
...
location / {
proxy_pass http://sampleapp;
}
}