Author |
|
jameslio
Joined: 03 Mar 2018 Posts: 5 Location: Australia
|
Posted: Sat 03 Mar '18 12:35 Post subject: Apache reverse proxy on different Virtual Machine |
|
|
Hi thanks for helping me in advance
Currently I am running on two oracle virtual machine
a. Plex Server
b. Website server with https
both of the above Virtual Machine has their own local IP address i.e. 192.168.1.x
I am wanting to host another website on a different domain name. The issue is I have only 1 external IP from the ISP. I have been looking around and the best I have come up with is Reverse Proxy but the tutorial is very vague for my situation.
If I want to host say for example:
a. https://abc.ddns.net -> Website 1 VM (192.168.1.5)
b. https://test.com -> Website 2 VM (192.168.1.6)
c. https://abc.ddns.net/plex -> Plex VM (192.168.1.7)
How do I even start getting this to work?
Thanks for your help in advance |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 08 Mar '18 11:13 Post subject: |
|
|
The answer is to use a reverse proxy with 2 vhosts.
Code: |
<VirtualHost *:443>
ServerName test.com
....
<Location />
ProxyPass http://192.168.1.6/
ProxyPassReverse http://192.168.1.6/
</Location>
</virtualhost>
<VirtualHost *:443>
ServerName abc.ddns.net
....
<Location />
ProxyPass http://192.168.1.5/
ProxyPassReverse http://192.168.1.5/
</Location>
<Location /plex>
ProxyPass http://192.168.1.7/
ProxyPassReverse http://192.168.1.7/
</Location>
</virtualhost>
|
|
|
Back to top |
|
jameslio
Joined: 03 Mar 2018 Posts: 5 Location: Australia
|
Posted: Fri 09 Mar '18 12:17 Post subject: Thanks but did not work |
|
|
Hi thanks for that the coding work sort of
when I tried
<VirtualHost *:443>
The website just don't want to load
but when I try
<VirtualHost *:*>
It load but with allot of missing images and formatting
It has something to do with the SSL. How do I reverse proxy on a website with existing SSL?
Thanks |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 10 Mar '18 13:14 Post subject: |
|
|
just replace the http:// in the ProxyPass and ProxyPassReverse with https://
if in the plex path images are missing it might be that you have to use mod_proxy_html to correct to those path or setup another sudomain just for that without a sub path in the url. |
|
Back to top |
|
jameslio
Joined: 03 Mar 2018 Posts: 5 Location: Australia
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 16 Mar '18 0:32 Post subject: |
|
|
The css files and or javascript is not loading. PLease use the developer tools from your browser and find out why not. |
|
Back to top |
|
jameslio
Joined: 03 Mar 2018 Posts: 5 Location: Australia
|
Posted: Fri 16 Mar '18 6:14 Post subject: No way that is the problem |
|
|
Look that can't be the problem, I can't access https://lioville.ddns.net when I go through reverse proxy.
There have to be people in here that got this to work right? Seriously Apache should be a matured tech? Or am I wrong? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 19 Mar '18 21:23 Post subject: |
|
|
jameslio wrote: |
There have to be people in here that got this to work right? Seriously Apache should be a matured tech? Or am I wrong?
|
James Blond wrote: | The css files and or javascript is not loading. PLease use the developer tools from your browser and find out why not. |
Of cause that should be done behind the reverse proxy.
Yes it can do it correctly, if configured correctly.
what does not show up? The pages doesn't show up at all? Or parts do not load?
You may post the config that you have tried and write what works and what doesn't. |
|
Back to top |
|
jameslio
Joined: 03 Mar 2018 Posts: 5 Location: Australia
|
Posted: Tue 20 Mar '18 11:54 Post subject: Nevermind |
|
|
Nevermind |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 20 Mar '18 15:38 Post subject: Re: Nevermind |
|
|
jameslio wrote: | Nevermind |
Did you solve it? if yes, please let us know. |
|
Back to top |
|