Opened 16 years ago
Last modified 9 years ago
#4963 new defect
Redirection problem with different hostnames in NAT
Reported by: | angel | Owned by: | ejucovy |
---|---|---|---|
Priority: | normal | Component: | PermRedirectPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Facts
- Server is named lets say 'herbert' with Trac
- Server is in a NAT, port 443 is open and forwarded to herbert
- dyndns account lets say myherbert.dyndns.org
- Trac 0.11, PermRedirect 2.0, AccountManager 0.2.1dev-r5479
What happens
- From inside the NAT, everything works perfect using https://herbert/trac/project
- From outside, using https://myherbert.dyndns.org/trac/project, is redirected to the login page. After entering the login data, the URL changes to https://herbert/trac/project which leads to a 'page not found' error.
This only happens when PermRedirect Plugin is enabled.
Attachments (0)
Change History (5)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Owner: | changed from Noah Kantrowitz to ejucovy |
---|---|
Summary: | Redirection problem with different hostnames → Redirection problem with different hostnames in NAT |
It would also be useful to know the value of the base_url
setting when this occurs.
comment:3 Changed 10 years ago by
Reported behaviour should be re-evaluated with a current version of AccountManagerPlugin, because redirection after login has seen substantial changes since 0.2.1dev. Btw 0.2.1dev has been rendered irrelevant due to so many fixed issues, that it seem silly to stay at such an ancient version any longer.
comment:4 Changed 9 years ago by
Hi,
I am experiencing an issue that seems to be the same. My setting is a bit different though (not NAT but proxy) :
My trac installation is behind a proxy. Trac itself is served with tracd in http, and the proxy serves it to the outside world in https. Only the outside url are used, and so I set trac: base_url
to my outside https url. Everything's working without any problem, except for this plugin, which redirect my to the almost right uri but not quite so : it removes the first part of the path, so instead of https://mytrac.org/trac/wiki
I'm redirected to https://mytrac.org//wiki
which doesn't exist.
I tried the patch in comment:1 , and it does solve my issue.
comment:5 Changed 9 years ago by
Ok, I just realized that trac: base_url
was https://mytrac.org/
instead of https://mytrac.org/trac
, if I change it to the latter, it also fixes my problem, without requiring to patch anything this time (I just hope I didn't break anything else, but it doesn't seem so).
I haven't figured out how to reproduce this. That said, PermRedirectPlugin passes the full request path as "referer", including the protocol and hostname. I don't think there's any need for it to do that, and it's possible that it's related to this problem.
If anyone is still experiencing this problem, could you try with this patch (against the plugin's trunk) and see if it makes any difference?
permredirect/filter.py