L
L
larinje2015-11-16 19:01:46
Nginx
larinje, 2015-11-16 19:01:46

How to configure a server with multiple Tomcats?

There is a local test server on which several Tomcats work at the same time (Actually 12). Each with one web application. Please tell me how correct is the option to install nginx as a proxy for tomcats. Or suggest a better solution. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gonchik Tsymzhitov, 2015-12-05
@larinje

My situation is a bit different. Namely, on different Tomkata servers,
and nginx acts as a revers-proxy and ssl encryption.
Nginx (configured with upstream proxy pass)

location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://tomcats  /;
  }

And on tomcats like this:
<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
         proxyName="apps.com"
               proxyPort="443"
                />
And everything works fine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question