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

Igor Sysoev is at rambler-co.ru
Thu Jan 22 20:20:34 MSK 2009


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

> 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?

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;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list