Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion Debian/Ubuntu
  • Search

Multiple Vm

Debian/Ubuntu related topics
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
zmalqp
Posts: 1
Joined: Fri May 18, 2018 2:22 pm

Os: Ubuntu 15x
Web: apache + nginx
Multiple Vm
  • Quote

Post by zmalqp » Fri May 18, 2018 3:24 pm

Hi!

For work I should realise a project as it follows:
Image

Where:
A and B use ubuntu 16.04 and they both have a vestacp installed correctly.

For now, I find myself with:

A - perfectly functioning
B - not reachable [but internally functioning (something like https://192.168.1.102)]

How can I make a reverse proxy or a redirect (or... any other idea is welcome!) from A machine to B machine?

Thank you!
Top

vanderheyde
Posts: 35
Joined: Fri Dec 08, 2017 3:48 pm

Os: Debian 7x
Web: apache + nginx
Re: Multiple Vm
  • Quote

Post by vanderheyde » Fri Jul 27, 2018 12:25 pm

Hi,

bit late to reply, but perhaps it's still relevant.

You can add an apache proxy between the router and the servers:
router (LAN): 192.168.1.1
proxy: 192.168.1.2
mysite.com: 192.168.1.101
dev.mysite.com: 192.168.1.102

On the proxy, add the following to /etc/apache2/apache2.conf:

Code: Select all

<VirtualHost *>
    ServerName mysite.com

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass / http://192.168.1.101/
    ProxyPassReverse / http://192.168.1.101/
    <Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>

<VirtualHost *>
    ServerName dev.mysite.com

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass / http://192.168.1.102/
    ProxyPassReverse / http://192.168.1.102/
    <Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>
However, I've noticed that only your default site on VestaCP can be accessed this way, since the proxy refers to IP's rather dan domain names (you could try adding hostnames in the proxypass setings, but I haven't tried that myself, yet).

This should do the trick (I'm using the same thing at home).
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: Multiple Vm
  • Quote

Post by mehargags » Sat Jul 28, 2018 7:18 am

The question is fundamentally wrong because in the router you would "forward a port" to a specific internal IP... you cannot do this to multiple IPs.
So you either have to change VestaCP port on "B" or use the proxy pass config as Vanderheyde suggested
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “Debian/Ubuntu”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password