Hello friends. I'm trying to accomplish the goal of binding two boxes to one IP address. We all know this isn't possible, but it seems as if a reverse proxy is the ticket. I looked through a multitude of guides, but I'm finding a large portion of these guides to leave me with some questions. Most guides are for nginx, which doesn't help me much given I'm using apache. Most of what I see is a little vague in certain areas, and the guides in question often differ in their approach (which doesn't exactly clarify things).
To lay out a few details, I have two servers ruing at my house. One is for basic web stuff + ownCloud + IRC etc. The other is ruing ZoneMinder and NAS-related uses, which I'd like to access exteally to get into the web interface of ZM. Both servers are Ubuntu Server 14.04.
Let's refer to these details (mostly so I can stay sane):
ownCloud/main web server = "web server" = 192.168.1.22
ZoneMinder/NAS box = "ZM server" = 192.168.1.20
Lastly, let's say my domain is myhomedomain.org
The goal is to have myhomedomain.org hit the web server, but I want to have a different URL to access the ZM box, such as zm.myhomedomain.org or myhomedomain.org/zm. Either works.
Another potential snafu: I have apache auto redirecting all http traffic as https, so if you hit http://myhomedomain.org it auto pipes it to https://myhomedomain.org.
Using Digital Ocean's approach, I have all of the modules activated, but their implementation is where I get a little gray.
Code:
<VirtualHost *:*>
ProxyPreserveHost On
# Servers to proxy the coection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
# Example:
ProxyPass / http://0.0.0.0:8080/
ProxyPassReverse / http://0.0.0.0:8080/
ServerName localhost
</VirtualHost>
Code:
<VirtualHost *:*>
ProxyPreserveHost On
# Servers to proxy the coection, or;
# List of application servers:
# Usage:
# ProxyPass / http://192.168.1.20:80/zm/
# ProxyPassReverse / http://192.168.1.20:80/zm/
# Example:
ProxyPass / http://192.168.1.20:80/zm/
ProxyPassReverse / http://192.168.1.20:80/zm/
ServerName localhost
</VirtualHost>
Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine On
# Set the path to SSL certificate
# Usage: SSLCertificateFile /path/to/cert.pem
SSLCertificateFile /etc/apache2/ssl/myhomedomain_org.crt
# Servers to proxy the coection, or;
# List of application servers:
# Usage:
# ProxyPass / http://192.168.1.20:80/zm/
# ProxyPassReverse / http://192.168.1.20:80/zm/
# Example:
ProxyPass / http://192.168.1.20:80/zm/
ProxyPassReverse / http://192.168.1.20:80/zm/
# Or, balance the load:
# ProxyPass / balancer://balancer_cluster_name
</VirtualHost>
Overall I'm a little unsure. If anybody has any suggestions, insight, or any sort of setup guides that might help I'd *greatly* appreciate it!
برچسب:
نویسنده: استخدام کار