logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.




Apache reverse proxy on different Virtual Machine

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
jameslio



Joined: 03 Mar 2018
Posts: 5
Location: Australia

PostPosted: Sat 03 Mar '18 12:35    Post subject: Apache reverse proxy on different Virtual Machine Reply with quote

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: 6352
Location: Germany, Next to Hamburg

PostPosted: Thu 08 Mar '18 11:13    Post subject: Reply with quote

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

PostPosted: Fri 09 Mar '18 12:17    Post subject: Thanks but did not work Reply with quote

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: 6352
Location: Germany, Next to Hamburg

PostPosted: Sat 10 Mar '18 13:14    Post subject: Reply with quote

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

PostPosted: Sat 10 Mar '18 14:05    Post subject: That does not work either Reply with quote

Hi that does not work either

https://lioville.ddns.net/owncloud/index.php/s/eK7PqXUFMyCFJ2O

and ran /etc/init.d/apache2 restart I still get page error

https://lioville.ddns.net/owncloud/index.php/s/ZMaTX7xBDxaavLl[/url]

However if I try changing it to http

https://lioville.ddns.net/owncloud/index.php/s/Tu8dAOiSnJgRgom

It almost work but the page is all messed up

https://lioville.ddns.net/owncloud/index.php/s/vwY0LumMkef5kWR
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6352
Location: Germany, Next to Hamburg

PostPosted: Fri 16 Mar '18 0:32    Post subject: Reply with quote

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

PostPosted: Fri 16 Mar '18 6:14    Post subject: No way that is the problem Reply with quote

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: 6352
Location: Germany, Next to Hamburg

PostPosted: Mon 19 Mar '18 21:23    Post subject: Reply with quote

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.


jameslio wrote:

Look that can't be the problem, I can't access https://lioville.ddns.net when I go through 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

PostPosted: Tue 20 Mar '18 11:54    Post subject: Nevermind Reply with quote

Nevermind
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6352
Location: Germany, Next to Hamburg

PostPosted: Tue 20 Mar '18 15:38    Post subject: Re: Nevermind Reply with quote

jameslio wrote:
Nevermind


Did you solve it? if yes, please let us know.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1