Question about SSIs: Can this be done?

djBon2112

Supreme [H]ardness
Joined
Jul 29, 2006
Messages
5,279
My home network has the following manageable elements:

* Edge router (pfsense)
* Manage switch WebGUI
* Three servers with Webmin
* BitTorrent (Deluge) WebGUI

...plus, a web server running on port 80 of my domain.

What I want to do, is have a secured page running on my webserver, that will let me acess all these pages from one location when I'm not at home (a management page). OK, easy enough. Problem is, all these elements are behind a NAT, and I'd rather not have to open up half a dozen random ports on my firewall to access them, plus the problem that, at school in my labs and at work, I can't access webpages that use non-standard ports (due to their NAT systems).

What I would like, is to use server-side includes, or some other simmilar technology, to generate the page I want (say, my router's management page) in my server (or route it through the server somehow) so that the only connection I need to the outside is the one on 80 (well, 443, since I want it to be secured, but that can come later!) on my web server.

Is this at all possible to do using HTML/PHP/CGI? The server runs Debian Lenny and Apache2. If someone is willing to throw together a sample page/config, I can give the exact local DNS names/IPs of the internal elements.
 
OK, I got it working last night (but I was kinda messed up ;)), but now it isn't and I have no idea why! I'm hoping someone here has used mod_proxy before and can help!

Here's my config file (the relevant parts, at least):

Code:
##
## Admin site, for admin.boniface.me on port 443
##
<VirtualHost *:443>
	ServerName admin.boniface.me
	ServerPath /

	ServerAdmin joshua@boniface.me

	DocumentRoot /var/www/boniface.me/admin

	# Turn on SSL and SSL Proxy
	SSLEngine on
	SSLProxyEngine on
	SSLCertificateFile /etc/apache2/ssl/admin-boniface-me/admin-boniface-me.crt
	SSLCertificateKeyFile /etc/apache2/ssl/admin-boniface-me/admin-boniface-me.key

	# Disable forward proxy requests since this isn't a proxy server
	ProxyRequests Off
	<Proxy *>
		Order deny,allow
		Allow from all
	</Proxy>

	# Require the username/password
	<Directory />
		AllowOverride AuthConfig 
		AuthType Basic
		AuthName "Restricted Area"
		AuthUserFile /etc/apache2/passwd
		Require user administrator 
	</Directory>

	##
	## This is the list of ProxyPasses: each one is an internal URL that maps to a device on the local network
	##

	# R01-Edge.boniface.me (Web GUI)
	<Directory /redir/r01edge/>
		ProxyPass https://10.100.0.1/
		ProxyPassReverse https://10.100.0.1/
	</Directory>
</VirtualHost>

So, that means, when I go to the url https://admin.boniface.me/redir/r01edge I get proxied access to https://10.100.0.1. That works. The problem is, it's failing at loading links. Any link on that page (it's a pfSense WebGUI) has this format:

https://admin.boniface.me/<pfsense_page.html>

..instead of:

https://admin.boniface.me/redir/r01edge/<pfsense_page.html>

...which is what I'd expect. I have no CSS on the page either, and I'll assume that it's being affected in the same way and that's why. Obviously this setup isn't working, since the server will only proxy /redir/r01edge to 10.100.0.1, not / (and I don't want it to, since there's an actual webpage in /). Anyone know why this isn't working properly? My syntax looks correct from what I've read, but last night was the first time I'd seen this so ;)...
 
Back
Top