Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1084 (closed defect: worksforme)

Opened 13 years ago

Last modified 12 years ago

turbogears.redirect fails if the tg app is deployed behind a proxy or rewrite mechanism

Reported by: jtate Owned by: anonymous
Priority: highest Milestone: 1.0
Component: CherryPy Version: 0.9a6
Severity: normal Keywords:
Cc:

Description

If you set up a method which *just* redirects, i.e.  http://externalhost.example.com/testredir, and your tg app is running at  http://localhost:8080/, your redirect will be to  http://localhost:8080/redirtarget, which if run from another system will give you a 404 at best, and most likely a could not connect to host error.

splee said that he would look into this tomorrow, but this should be considered a blocker for 1.0.

Note that this problem is most noticeable when using the identity framework; after a successful login, a redirect occurs and the new host is sent, canceling out the session cookie already established.

Change History

comment:1 Changed 13 years ago by splee

  • Status changed from new to closed
  • Resolution set to worksforme

I have found the solution to this through cherrypy. base_url_filter needs to be configured in your .cfg.

Since I'm using apache2 I've set the following:

base_url_filter.on = True base_url_filter.use_x_forwarded_host = True

comment:2 Changed 13 years ago by splee

Quickstart template updated in [1793]

comment:3 Changed 13 years ago by mbevan

To make sure relative redirects work, ensure that Apache is redirecting to the correct base path. I had mine redirecting /booking/* to  http://localhost:8080/* which was causing lots of problems. The correct path should have been  http://localhost:8080/booking/*

Note: See TracTickets for help on using tickets.