I have a bunch of RPI's running as web-servers at home. I can connect to one of my RPI's(RPI-1) via VPN and it can see the other RPI's on the LAN. From my VPN connection I can see the website hosted on RPI-1 but not the other RPI's websites(Because they are on the LAN and not connected on the VPN).

Is there a way that I can use RPI-1 to do port forwarding? Making RPI-1:9000 point to one of the other RPI's on the LAN?

1 Answer 1


You can either

  • use iptables (which should be preinstalled on most Linux distributions) to do actual port forwarding (i.e. make rpi2's webserver accessible via http://rpi1:2000/ or some other port of your choice) or
  • use the webserver on rpi1 as a reverse proxy to make rpi2 accessible via a (virtual) directory like http://rpi1/rpi2/. The configuration required for that depends on what webserver software is doing the proxying (in this case, the one on rpi1); e.g. for Apache:

    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
        Order deny,allow
        Allow from all
    ProxyPass /rpi2/ http://rpi2/
    ProxyPassReverse /rpi2/ http://rpi2/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.