# Problems with upstream

**URL:** <https://www.ruby-forum.com/t/problems-with-upstream/187270>\
**Category:** NGINX\
**Created:** [April 20, 2010, 10:23pm UTC](https://www.ruby-forum.com/t/problems-with-upstream/187270 "2010-04-20T22:23:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mevans336](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mevans336](https://www.ruby-forum.com/u/mevans336)\
**Post date:** [April 20, 2010, 10:23pm UTC](https://www.ruby-forum.com/t/problems-with-upstream/187270/1 "2010-04-20T22:23:22Z")

</div>

Hello,

I am working on replacing our Kemp Loadbalancers with nginx and so far,  
things look good except for a minor issue. When a request comes into my  
server on the HTTP port, our JBoss server uses ACEGI to redirect to  
[https://www.myserver.com/dev/home](https://www.myserver.com/dev/home). The first time this redirection  
occurs, I’m sent to the URL of my proxy\_pass directive.

I am running version 0.7.65 stable on CentOS 5.4. Here is my  
configuration file:

error\_log /var/log/nginx\_error.log;  
worker\_processes 2;

events {  
worker\_connections 4096;  
}

http {  
ssl\_session\_cache shared:SSL:10m;  
ssl\_session\_timeout 10m;

upstream jboss\_dev\_servers {  
server 192.168.2.86:8080;  
server 192.168.2.87:8080;  
}

server {  
listen 80;  
listen 443 default ssl;  
access\_log /var/log/nginx\_access.log;  
keepalive\_timeout 70;  
server\_name [www.myserver.com](http://www.myserver.com);  
ssl\_certificate dev.crt;  
ssl\_certificate\_key dev.key;  
ssl\_protocols SSLv3 TLSv1;  
ssl\_ciphers HIGH:!ADH:!MD5;  
location / {  
proxy\_pass http://jboss\_dev\_servers;  
}  
}  
}

When a user types in [www.myserver.com](http://www.myserver.com), they are redirected to  
https://jboss\_dev\_servers/dev/home. If I hit refresh, they are then  
directed to the proper url ([https://www.myserver.com/dev/home/](https://www.myserver.com/dev/home/)) and the  
web page displays.

Any ideas?

Posted at Nginx Forum:

> **[Problems with upstream](https://forum.nginx.org/read.php?2,77284,77284#msg-77284)**
>
> Hello, I am working on replacing our Kemp Loadbalancers with nginx and so far, things look good except for a minor issue. When a request comes into my server on the HTTP port, our JBoss server uses ACEGI to redirect to...

---

<div class="post-metadata">

**Author:** ![mevans336](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mevans336](https://www.ruby-forum.com/u/mevans336)\
**Post date:** [April 20, 2010, 11:52pm UTC](https://www.ruby-forum.com/t/problems-with-upstream/187270/2 "2010-04-20T23:52:57Z")

</div>

On Tue, Apr 20, 2010 at 3:22 PM, mevans336 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> When a user types in [www.myserver.com](http://www.myserver.com), they are redirected to https://jboss\_dev\_servers/dev/home. If I hit refresh, they are then directed to the proper url ([https://www.myserver.com/dev/home/](https://www.myserver.com/dev/home/)) and the web page displays.
> 
> Any ideas?

proxy\_set\_header Host $host;

The above is required for one of my JBoss apps, which uses Tomcat  
security. The back-end doesn’t do relative redirects, and takes  
whatever is in the host header from the client when constructing  
redirect URLs. So you have to send it the host name.

–  
RPM

---

<div class="post-metadata">

**Author:** ![mevans336](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mevans336](https://www.ruby-forum.com/u/mevans336)\
**Post date:** [April 21, 2010, 3:23am UTC](https://www.ruby-forum.com/t/problems-with-upstream/187270/3 "2010-04-21T03:23:41Z")

</div>

Thanks Ryan, that did it. Any other tips for nginx and JBoss/Tomcat?

Posted at Nginx Forum:

> **[Re: Problems with upstream](https://forum.nginx.org/read.php?2,77284,77377#msg-77377)**
>
> Hello, I am working on replacing our Kemp Loadbalancers with nginx and so far, things look good except for a minor issue. When a request comes into my server on the HTTP port, our JBoss server uses ACEGI to redirect to...

---

<div class="post-metadata">

**Author:** ![mevans336](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mevans336](https://www.ruby-forum.com/u/mevans336)\
**Post date:** [April 21, 2010, 1:21pm UTC](https://www.ruby-forum.com/t/problems-with-upstream/187270/4 "2010-04-21T13:21:57Z")

</div>

On Tuesday, April 20, 2010, mevans336 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks Ryan, that did it. Any other tips for nginx and JBoss/Tomcat?

Just make sure you explicitly set explicit thread pool settings and  
timeouts on the tomcat side. We discovered that even though the  
documentation specifies a deault of 250 threads, the default was  
actually 40. This departure from the documentation was confirmed by  
load testing and looking at the running connector settings in  
jmx-console.

–  
RPM
