logout redirects to localhost, when TG site is on other box

18 views
Skip to first unread message

Matt Wilson

unread,
Nov 29, 2006, 9:03:37 PM11/29/06
to TurboGears
I'm connected remotely to my site, but when I log out, I get redirected
to localhost, which isn't running a TG instance.

Any ideas what I'm doing wrong?

My logout controller hasn't been touched:

@expose()
def logout(self):
identity.current.logout()
raise redirect("/")

Matt

Lee McFadden

unread,
Nov 30, 2006, 7:55:33 AM11/30/06
to turbo...@googlegroups.com

At a guess I would say that you're running your app behind apache via
mod_proxy or using mod_rewrite to proxy.

Make sure that you have the following in your prod.cfg (or dev.cfg if
you're still using that while testing your app):

base_url_filter.on = True
base_url_filter.use_x_forwarded_host = True

If that isn't the problem, a little more detail on your setup would be helpful.

Lee


--
Lee McFadden

blog: http://www.splee.co.uk
work: http://fireflisystems.com
skype: fireflisystems

iain duncan

unread,
Dec 2, 2006, 2:18:48 PM12/2/06
to turbo...@googlegroups.com

> > My logout controller hasn't been touched:
> >
> > @expose()
> > def logout(self):
> > identity.current.logout()
> > raise redirect("/")
> >
>
> At a guess I would say that you're running your app behind apache via
> mod_proxy or using mod_rewrite to proxy.
>
> Make sure that you have the following in your prod.cfg (or dev.cfg if
> you're still using that while testing your app):
>
> base_url_filter.on = True
> base_url_filter.use_x_forwarded_host = True
>
> If that isn't the problem, a little more detail on your setup would be helpful.

I was getting redirect to *my* local host when I put my rewrite rules in
without [P] at the end. If you do not have mod_proxy enabled in apache,
you'll need to do so or the rule with [P] will just fail with no clue as
to why. I also discovered that I had to remove the Multiviews option in
my apache directory directive to stop .html getting pasted on to the end
of my rewrite.

Iain


Reply all
Reply to author
Forward
0 new messages