I'm not sure this can be done nicely, but maybe someone has an idea.
I have 2 sites (as in "datacenters") located miles apart. the "local" one, named "destination" and remote one named "source" on the sketch.
In my "local" site, I have 2 physical esxi servers, hosting a bunch of everything ( a lot more than what is pictured, only what is relevant is pictured)
In my "remote" site, I have 2 physical servers running CentOS 5 and they are too old for anything and too expensive to put a new server in, so I decided to migrate some of the resources there to my local site.
Both apache servers are hosting 1 wordpress multisite and some other php and non-php websites. And they are both behind an nginx server.
I have successfully migrated sourceA.com to detination as sourceA.com (DNS still points to the old site and nginx is proxy-ing to my "local" nginex, which is proxy-ing to apache
As is, this works as expected from the outside world.
The other websites and services on source also function ok.
My problem is that I'd like to do some maintenance on siteA, from my local LAN without going to source.com and getting proxied back...
I think it's a reasonable request :)
Now, I can setup either my local dnsmasq OR my PCs hosts file so that when accessing "siteA.com" from the webbrowser it will do what I want.
But now, I cannot access my email on siteA.com because the IP no longer hits the "source" server but hits my LAN apache or nginx server.
Same goes when ssh-ing to the other side.
(yes, I can try using one of the other domains and modify my scripts and everything, but I really don't want to get into modifing settings and scripts I've put in place ages ago. If it ain't broken, don't fix it. Those work fine, so I need something that doesn't potentially bust something up)
I tried to configure a local multisite alias for this domain (siteA). But because the multisite is configured with "default" alias on "siteA.com", the moment the browser hits WP with "siteA.local" it gets a 302 to "siteA.com" and goes to source server and gets proxied.
I guess the next step is to hack into WP and make it not redirect on local aliases, but then I'll have to do that change every time WP gets updated. I wasn't able to find a plugin that disables this or somehow allows custom filtering on what gets redirected.
Anyone having a better idea?