Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3056240
  • 博文数量: 535
  • 博客积分: 15788
  • 博客等级: 上将
  • 技术积分: 6507
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 09:11
文章分类

全部博文(535)

文章存档

2016年(1)

2015年(1)

2014年(10)

2013年(26)

2012年(43)

2011年(86)

2010年(76)

2009年(136)

2008年(97)

2007年(59)

分类: 系统运维

2009-03-04 09:14:37

All admins of advanced Apache setups will cross this problem someday. So did I :)

You have some nice reverse proxy setup, everything working just fine, except that one redirect that happens on one of the backend machines to a non default port.
You have no choice then redirect that to a default port. I searched long after this, and with me a collegue

Lets say when you surf to , you are proxied to backend server with ip 193.155.88.23. End for example that backend server redirects you to a non-default port like 8443. And you end up with your browser going to 193.155.88.23:8443 directly. If these ports aren't blocked already, you'll probably go to somewhere completely different.
Normal redirects are catched by your proxy and you'll not see a thing, but not these.

Everybody knows the mod_rewrite module, but that only handles request headers. For this you need to change to response headers. You could do this with some fancy stuff with something self written for using mod_perl or so, but the solution is by far more simplier.

mod_headers is the answer to this problem:

In your VirtualHost config for that machine on your proxy:

Header edit Location ^

This will have as a result that the location header send by your backend server will be changed to if it starts with . Your browser directly go to and problem is solved.

阅读(1247) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~