March 16th, 2012, 08:00 AM
Dynamic DNS and reverse proxies: Can this be done?
Here is my situation. I have a LAN at home, behind a regular router.
I have my server on 192.168.0.9, on this I have bind9 running, apache2 on port 80. Tomcat on port 8082 and another tomcat on port 8083.
I have successfully setup bind so that when I am inside my LAN I can enter:
app1.mylan.com Apache will reverse proxy this to app1.mylan.com:8082 and it shows in the browser as app1.mylan.com
Same goes for app2. (i.e. app2.mylan.com -> app2.mylan.com)
However, my router has dynamic dns setup.
How can I reach app1.mylan.com via dynamic dns. I've tried setting up a URL redirect with my DNS provider (even enabling cloaking)
but what happens is that in the browser, the apache server tries to serve up the content as if it was on port 80, and I get a 404 (I see the dyndns address in the page returned).
It's as if the reverse proxy is not working due to the dyn dns.
Can this be done with dynamic dns???
March 23rd, 2012, 11:51 AM
I've never attempted this before, but, doing some "google research" it looks as if this should be possible by setting up another Vhost for your dynamic dns host/domain and using ProxyPass and ProxyPassReverse to point to your app1 and app2 sites.
Something like this:
this should, in effect, passthru any requests for your dynamicdns host /app1 folder to app1 and app2 folder to app2.
ProxyPass /app1 http://app1.mylan.com:8082/
ProxyPass /app2 http://app2.mylan.com:8083/
ProxyPassReverse /app1 http://app1.mylan.com:8082/
ProxyPassReverse /app2 http://app2.mylan.com:8083/
As I said, I've never attempted anything like this , so, I dunno if it'll work or not.