Should I use upsterm for a tomcat, without having 2 tomcats?


#1

I have a single server, running a single tomcat instance. I have set it
up like this:

upstream tomcat {
server 127.0.0.1:8180;
}

server {
listen 80;
server_name webmail.example.org *.webmail.example.org;

access_log /var/log/nginx/webmail-access_log;
error_log /var/log/nginx/webmail-error_log info;

location / {
root /srv/www/example.org;
index index.jsp index.php index.html index.htm;
rewrite ^ /intouch/ redirect;
}

location /intouch {
proxy_pass http://tomcat/intouch;
include /etc/nginx/proxy.conf;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}

}

Now I know that upstream should be used for load balancing, but does it
make a difference if I use tomcat only with proxy_pass or if I use it
with upstream and proxy_pass?

Can anyone tell me the difference, besides load balancing idea?


#2

On Thu, Jan 22, 2009 at 05:29:07PM +0100, Robert G. wrote:

server_name webmail.example.org *.webmail.example.org;
location /intouch {

Now I know that upstream should be used for load balancing, but does it
make a difference if I use tomcat only with proxy_pass or if I use it
with upstream and proxy_pass?

Can anyone tell me the difference, besides load balancing idea?

The single difference is default “Host” header. It will be “tomcat” in
case

 proxy_pass http://tomcat/intouch;

and “127.0.0.1:8180” in case

 proxy_pass http://127.0.0.1/intouch;

#3

Im asking as performance if it would improve it or … make it worst?


#4

On Thu, Jan 22, 2009 at 06:51:15PM +0100, Robert G. wrote:

Im asking as performance if it would improve it or … make it worst?

No difference.


#5

Igor S. wrote:

On Thu, Jan 22, 2009 at 06:51:15PM +0100, Robert G. wrote:

Im asking as performance if it would improve it or … make it worst?

No difference.

Ok thx then! :slight_smile: