For test purpose, I have 2 backend tomcat running on one box, the nginx is running on separate box on CentOS.
I have a nginx conf like this:
upstream backend {
#ip_hash;
server 10.10.10.120:8081; # this has a jsp page say "tomcat 1"
server 10.10.10.120:8080; # this has a jsp page say "tomcat 2"
}
While I stop the 1st tomcat and keep 2nd one alive, I go to my nginx server url, http://10.10.10.121/HelloWorld/HelloWorld.jsp and refresh manually, I can see the page content "tomcat 2", so far so good, then I refresh again, the page is loading...and loading... instead of show content "tomcat 2" (since 1st tomcat is down), it should show content "tomcat 2" straight away, after I refresh the page, right ?
Then I keep refresh the page, what happen is:
...
show "tomcat 2"
loading ......
show "tomcat 2"
loading ......
show "tomcat 2"
loading ......
show "tomcat 2"
loading ......
show "tomcat 2"
loading ......
...
I wonder why it is loading ? is my ip_hash config wrong ??
I have a nginx conf like this:
upstream backend {
#ip_hash;
server 10.10.10.120:8081; # this has a jsp page say "tomcat 1"
server 10.10.10.120:8080; # this has a jsp page say "tomcat 2"
}
While I stop the 1st tomcat and keep 2nd one alive, I go to my nginx server url, http://10.10.10.121/HelloWorld/HelloWorld.jsp and refresh manually, I can see the page content "tomcat 2", so far so good, then I refresh again, the page is loading...and loading... instead of show content "tomcat 2" (since 1st tomcat is down), it should show content "tomcat 2" straight away, after I refresh the page, right ?
Then I keep refresh the page, what happen is:
...
show "tomcat 2"
loading ......
show "tomcat 2"
loading ......
show "tomcat 2"
loading ......
show "tomcat 2"
loading ......
show "tomcat 2"
loading ......
...
I wonder why it is loading ? is my ip_hash config wrong ??