UPDATE: I added a modified question after experimenting by using it two solutions below.
If you are reading through this you are most likely acquainted with Apache's mod_proxy and it is ProxyPass function. Like many more, I've the problem of getting a credit card applicatoin will be able to access from outdoors our internal network, but that application itself accesses other internal applications on different machines, and when you are getting into remote access with this particular setup, things go wonky.
So, my setup really is easy, I've:
Machine #1 has remote access enabled, I can get on via a host title also it spits the PHP application running onto it.
Machine #2 is really a new application running Django, it uses a completely different after sales (even auth), it's located on the seperate machine. Within our intranet, we can get on via a simple named hostname which essentially links towards the internal 192.168..101 ip.
I have attempted having fun with ProxyPass to put it together so for instance, a pass to /new would send it towards the new application:
ProxyPass /new http://192.168.0.101/
This type of works, it will get the request towards the other application, however it breaks because my Django application really wants to redirect to /auth/login/, so it instantly doesn't recognize. Basically customize the url myself to become foo.internet/new/auth/login I recieve my login page, but as possible guess carrying this out throughout browsing isn't convenient.
So how do i get ProxyPass to operate when i want? Should i make a move with Apache therefore it always creates /new before url's within the other application, or perhaps is this something I ought to modify inside my Django application?
Any tips and pointers too could be greatly appreciated. Interesting time
In my opinion you could solve the issue while using ProxyPassReserve directive. Read about this here.
You need to modify your django application to anticipate to become at /new/auth/login rather than /auth/login. Generally your proxy passes need to look like so:
ProxyPass /path http://192.168.0.101/path ProxyPassReverse /path http://192.168.0.101/path
That coupled with your Django application looking to attend /new/ should fix your issues.
Interesting reactions, I am responding to my very own question because it needs some revisions after having fun with this.
So after speaking with a few #apache men from irc, I discovered that I have to make a move such as this:
RewriteCond % ^app2.myremotedns.com*
RewriteRule .* http://192.168.0.101/ [P]
What this may is send a rewrite rule for just about any demands to app2.myremotedns.com to be delivered to the interior ip via proxy.
This works somewhat but has three issues:
With login needed on all of the pages, Basically access anything remotely on app2, it redirects to /auth/login .. however, because of the present Rewrite setup, I recieve a redirect loop before Opera just stops using the path. I suppose this may have something related to Django's redirect techniques but I am less than sure.
Basically disable login, the web pages type of work, although not fully. I appear to have the ability to fetch the index page of Application#2 but little else really
Static media is damaged, but this really is most likely an easy fix .. not concerned about it at this time.
So, I've got a more complicated problem i quickly imagined... :)
If you want to understand, look at this step-by-step illustration of reverse proxies.