Cannot Get Reverse Proxy to Work
Posted: Wed Jan 19, 2011 11:54 am
I currently have three web apps installed on my HDA: TinCanJukebox, Gallery3 and WordPress, and I'll likely add more in the future. I'd like to be able to access these apps via the web. I've purchased and set up a domain name (mydomain.com) to forward to my HDA domain name (username.yourhda.com). I've also set up port forwarding on my router's firewall, so I can successfully access my HDA dashboard. When I click on one of the three web apps from the HDA dashboard, such as TinCanJukebox, it tries to open a URL based on my LAN domain name (jukebox.homedomain.com). Of course this fails when outside my home network.
I tried Web-Apps-Proxy, but I wanted to have a separate URL for each web app while using one domain name. That way I could send my in-laws the URL to get directly to Gallery3, rather than opening a landing page and then navigating to the appropriate web app.
One option I found was to set up a reverse proxy for each web app, so they would have the following URL's:
-mydomain.com/music --> TinCanJukebox
-mydomain.com/pictures --> Gallery3
-mydomain.com/blog --> WordPress
I edited the Apache httpd.conf file by adding the following lines:
ProxyRequests Off
<Proxy*>
Order deny,allow
Allow from all
<Proxy/>
ProxyPass /music http://jukebox.homedomain.com
ProxyPassReverse /music http://jukebox.homedomain.com
I then restarted the Apache server and tried accessing the URL mydomain.com/music, which successfully tried to forward to username.yourhda.com/music. However, I received a 400 Bad Request Error, stating that the browser sent a request that the server could not understand.
I've confirmed that the URL http://jukebox.homedomain.com works while inside my network, so there must be something wrong with my reverse proxy configuration. The reverse proxy syntax seems pretty straightforward, so I must be missing something pretty obvious. I'm a relative noob to the Linux/Apache world, so any help would be greatly appreciated!
I tried Web-Apps-Proxy, but I wanted to have a separate URL for each web app while using one domain name. That way I could send my in-laws the URL to get directly to Gallery3, rather than opening a landing page and then navigating to the appropriate web app.
One option I found was to set up a reverse proxy for each web app, so they would have the following URL's:
-mydomain.com/music --> TinCanJukebox
-mydomain.com/pictures --> Gallery3
-mydomain.com/blog --> WordPress
I edited the Apache httpd.conf file by adding the following lines:
ProxyRequests Off
<Proxy*>
Order deny,allow
Allow from all
<Proxy/>
ProxyPass /music http://jukebox.homedomain.com
ProxyPassReverse /music http://jukebox.homedomain.com
I then restarted the Apache server and tried accessing the URL mydomain.com/music, which successfully tried to forward to username.yourhda.com/music. However, I received a 400 Bad Request Error, stating that the browser sent a request that the server could not understand.
I've confirmed that the URL http://jukebox.homedomain.com works while inside my network, so there must be something wrong with my reverse proxy configuration. The reverse proxy syntax seems pretty straightforward, so I must be missing something pretty obvious. I'm a relative noob to the Linux/Apache world, so any help would be greatly appreciated!