i have a apache server located on a.com:9254 I would like to route a.y.com:80 to a.com:9254. So, I can put all my services under y.com domain.

I tried proxy. However, In apache, it looks all requests comes from same ip. It fails my security system. I can not change it. I need a full transparent solution.

Maybe NAT can be a solution, but I don't have enough knowledge..

Thank you very much.

link|improve this question
feedback

2 Answers

The apache reverse proxy is the best solution for what you need. You just need to change the apache log format of the a.com:9254 site to include the X-Forwarded-For.

See the example took from http://www.techstacks.com/howto/log-client-ip-and-xforwardedfor-ip-in-apache.html

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog "logs/access_log" combined env=!forwarded
CustomLog "logs/access_log" proxy env=forwarded

Another solution is to use a iframe on a.y.com and embed the a.com:9254 site in the iframe element.

link|improve this answer
feedback

routing is used for layer 3... (IPs) only. You're talking about forwarding a port... which is done by "NATing"

NATing changes IPs... and is probably not what you're looking for. You should simply setup a "redirect" on server "a.y.com" to "a.com:9254". mod_rewrite can help you with this.

link|improve this answer
I think that he wants to hide that the pages are served by a.com:9254 and display a.y.com in the browser. – Mircea Vutcovici Jan 6 at 17:29
He did indicate that he was going to move the site from a.y.com to a.com:port ... but I did +1 your answer too. Very good solution too. – TheCompWiz Jan 6 at 17:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.