You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mike Lyon <mi...@gmail.com> on 2009/03/27 09:19:11 UTC

[users@httpd] HTTPS to HTTP proxy server that talks to a Jboss server running Tomcat...

Hello All,

I ran into an issue today while I was configuring an HTTPS to HTTP proxy
utilizing mod_ssl and mod-proxy. I am using the proxy server as my front-end
SSL offloader. In front of the proxy is my router that is doing NAT.

So the problem I am having is that I can reach the site from the outside via
the NAT'd IP of the proxy server but when I try to login to the app, it will
come up and say, "your session has timed out. Please try again." So I went
to the proxy server locally and brought up firefox and went to the internal
HTTP webserver directly and I was able to log in just fine.

I know nothing about Jboss and Tomcat but it seems to me that problem is
with the proxy, not Jboss or Tomcat as I can login successfully to the local
webserver from the proxy console.

Anyone here have any ideas of what might be happening? I have increased the
TTLs in the proxy statements in the specific vhost but no luck. Could this
be a cookie issue and/or does caching need to be configured on the proxy?

Thank You in advance.

Cheers,
Mike

Re: [users@httpd] HTTPS to HTTP proxy server that talks to a Jboss server running Tomcat...

Posted by Krist van Besien <kr...@gmail.com>.
On Fri, Mar 27, 2009 at 1:37 PM, Krist van Besien
<kr...@gmail.com> wrote:
> On Fri, Mar 27, 2009 at 9:19 AM, Mike Lyon <mi...@gmail.com> wrote:
>
>> So the problem I am having is that I can reach the site from the outside via
>> the NAT'd IP of the proxy server but when I try to login to the app, it will
>> come up and say, "your session has timed out. Please try again." So I went
>> to the proxy server locally and brought up firefox and went to the internal
>> HTTP webserver directly and I was able to log in just fine.
>
> Looks like some session information is being lost.

I just realis it might be a cookie problem. Often a webapplication
will give a cookie back to the browser upon succesfull login. However,
when the browser doesn't present this cookie with all following
requests the webapplication will think the requests come from a
browser not (or no longer) authenticated.
On reason why this sometimes happens is that the cookiedomain is set
to the hostname of the application server.

So waht happens is this:
Browser sends request to www.website.com, which forwards the request
to interalappserver.
User gets a login page, and logs in. The response contains a cookie
with cookiedomain "interalappserver".
The next request the browser sends will not contain the cookie, as the
browser ill only send cookies with cookiedomain "website.com". Result:
the appserver things the session is invalid or has expired.

Solution.
a) have your app server generate cookies with the correct domain.
Generally it is often a good idea to configure an appserver sitting
behind a proxy as if it was on the proxy itself. Ie set its base url,
cookiedomain etc to values you would set it if there was no proxy.
b) Look at translating the cookies on the proxy server. Look at:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreversecookiedomain

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] HTTPS to HTTP proxy server that talks to a Jboss server running Tomcat...

Posted by Krist van Besien <kr...@gmail.com>.
On Fri, Mar 27, 2009 at 9:19 AM, Mike Lyon <mi...@gmail.com> wrote:

> So the problem I am having is that I can reach the site from the outside via
> the NAT'd IP of the proxy server but when I try to login to the app, it will
> come up and say, "your session has timed out. Please try again." So I went
> to the proxy server locally and brought up firefox and went to the internal
> HTTP webserver directly and I was able to log in just fine.

Looks like some session information is being lost. However there is
not much I can say without knowing more about your setup. Try tracing
a session using a tool like the HTTP_Headers or Firebug plugin for
firefox, and see if there are differences in the HTTP dialog between
going via the proxy and going directly.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org