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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
15fc40290c76b33850cc13438566b072?d=identicon&s=25 Robert Gabriel (jinx)
on 2009-01-22 17:29
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?
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-01-22 18:32
(Received via mailing list)
On Thu, Jan 22, 2009 at 05:29:07PM +0100, Robert Gabriel 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;
15fc40290c76b33850cc13438566b072?d=identicon&s=25 Robert Gabriel (jinx)
on 2009-01-22 18:51
Im asking as performance if it would improve it or ... make it worst?
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-01-22 19:44
(Received via mailing list)
On Thu, Jan 22, 2009 at 06:51:15PM +0100, Robert Gabriel wrote:

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

No difference.
15fc40290c76b33850cc13438566b072?d=identicon&s=25 Robert Gabriel (jinx)
on 2009-01-22 20:03
Igor Sysoev wrote:
> On Thu, Jan 22, 2009 at 06:51:15PM +0100, Robert Gabriel wrote:
>
>> Im asking as performance if it would improve it or ... make it worst?
>
> No difference.

Ok thx then! :)
This topic is locked and can not be replied to.