• Photos Photos
  • Linked In Linked In
  • Google + Google +
  • Facebook Facebook
  • Flickr Flickr
  • Vimeo Vimeo

www.gavinwill.me.uk

Photography, IT, Bikes and more.

  • Pages

    • About
    • Blog
    • Contact
    • Home
  • Archives

    • January 2013
    • September 2012
    • August 2012
    • July 2012
    • June 2012
    • May 2012
    • April 2012
    • March 2012
    • February 2012
    • January 2012
    • December 2011
    • November 2011
  • Search:

Posts

  • View Archive

Raspberry Pi and Reverse Proxy

With finally ordering a Raspberry Pi but not having recieved it yet I am testing the concept of using the Raspberry Pi as a Reverse Proxy to easily allow me access to a few devices I have at home without having to rely on running web services on different ports since I only have the 1 public IP address at home. By simply using a reverse proxy on the Raspberry Pi I can easily access kit at home using different hostnames. A quick test on a virtual machine proved the concept.

After installing apache I needed to enable to proxy module with the command:

a2enmod proxy_http

a2enmod proxy_http

Then simply setup the apache sites with the following info:

<VirtualHost *:80>
 
ServerName device1.mydomain.com
 
    ProxyPreserveHost On
    ProxyRequests off
    ProxyPass / http://internadevice1/
    ProxyPassReverse / http://internaldevice1/
 
</VirtualHost>
 
<VirtualHost *:80>
 
ServerName device2.mydomain.com
 
     ProxyPreserveHost On
     ProxyRequests off
     ProxyPass / http://internaldevice2:8080/
     ProxyPassReverse / http://internaldevice2:8080/
 
</VirtualHost>

<VirtualHost *:80> ServerName device1.mydomain.com ProxyPreserveHost On ProxyRequests off ProxyPass / http://internadevice1/ ProxyPassReverse / http://internaldevice1/ </VirtualHost> <VirtualHost *:80> ServerName device2.mydomain.com ProxyPreserveHost On ProxyRequests off ProxyPass / http://internaldevice2:8080/ ProxyPassReverse / http://internaldevice2:8080/ </VirtualHost>

Adding the DNS entries and testing by browsing to device1.mydomain.com and device2.mydomain.com resulted in the access to the correct internal devices.

Naturally this is just a proof of concept and needs a bit more work to ensure secure but It will mean with the Raspberry Pi I can use it as a way to easily connect to internal devices with simply having 1 port open rather than numerous ports all for different devices. With some of my devices only offering http support I can add a self signed SSL certificate to the Apache Reverse Proxy to stop any sniffing of usernames and passwords if I were just browsing http over the internet.

*Update* I have now recieved the Pi and it is working great as a reverse proxy. Running top whilst using the proxy I can see the processor usage is minimal at around 3% so even although it is a low powered device it is handling this very well.

  • June 3, 2012
  • Linux, Rapsberry Pi
  • 0

Discussion2 Comments

  1. james says:
    June 8, 2013 at 4:42 pm

    Hi Gavin,

    I’m really struggling to get a reverse proxy working on my Raspberry Pi. I’d be very grateful if you could possibly add some more details to the above article?

    James

    Reply
  2. Gavin says:
    July 22, 2013 at 7:30 am

    Hi James. What problems are you having with setting up the reverse proxy? Will see if I can help. Cheers, Gavin

    Reply
Cancel Reply

Copyright © 2021 www.gavinwill.me.uk.

  • LinkedIn
  • Google +
  • Facebook
  • Flickr
  • Vimeo
Back to Top