• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

redirects to wrong port after login when jforum is running behind a reverse proxy

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I ran into a problem when deploying JForum in our network setup. We use a reverse proxy (squid). Every time someone logged in, the browser was redirected to a url that could not be resolved.

The problem could be boiled down to these lines of code (in UserAction.validateLogin()):

When I just use this code:

I can login just fine.

The problem is that the reverse proxy sets the "X-Forwarded-Host" header to a virtual host configured on apache running on a different server (e.g. it redirects www.tst.nl and sets the header to www.tst.nl:8000). Now when the above code constructs the redirect url with this header entry, the request comes back to our squid server, which is not listening on this port, which causes the error.

On the contrary, after reading here it seems other people were getting problems with this code when behind a regular proxy server. So perhaps this code could be modified to take a reverse proxy setup into account?

Regards,
Alex
[originally posted on jforum.net by buijs]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm having the same problem using a reverse proxy. I hadn't not identified the source of the problem, so thank you very much, Alex.

Cheers,
Jonathan
[originally posted on jforum.net by jooooooon]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Added to Jira:

http://www.jforum.net/jira/browse/JF-683

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, bug fixed. Added a new configuration key named "login.ignore.xforwardedhost"

Rafael
[originally posted on jforum.net by Rafael Steil]
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic