Multiple Internal IP Addresses for a Single External IP Address


I have two printers and I am thinking about getting a third printer. I would like to hit OctoPrint from my work and check up on both printers (and soon all three printers). However, I can only forward the external ip address to one OctoPrint. Can we add a button or menu choice that allows us to switch over to the other internal ip addresses so we can view the other OctoPrint servers?


Are you running them on the same pi?

I have two printers on the same pi that I can access individually from outside my network.
printer 1 is at
printer 2 is at

I'll give a quick rundown of what I have done besides what is in the link above.

  1. I own a domain so I put an A record pointing to my home IP address with a host of cr10-a and cr10-b
  2. see image for port forwarding info for your router (2 printers and 2 webcams)
  3. My haproxy looks like this
        maxconn 4096
        user haproxy
        group haproxy
        tune.ssl.default-dh-param 1024
        log local1 debug

        log     global
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        option http-server-close
        option forwardfor
        maxconn 2000
        timeout connect 5s
        timeout client  15min
        timeout server  15min

frontend public
        bind *:80
        option forwardfor except
        use_backend webcam if { path_beg /webcam/ }
        use_backend webcam2 if { path_beg /webcam2/ }
	acl host_CR10-A hdr_beg(host) -i CR10-A
	acl host_CR10-B hdr_beg(host) -i CR10-B
	use_backend octoprint if host_CR10-A
	use_backend octoprint2 if host_CR10-B
        default_backend octoprint
        errorfile 503 /etc/haproxy/errors/503-no-octoprint.http

frontend webcamonly
        bind *:9080
        option forwardfor except
        default_backend webcamstream
        errorfile 503 /etc/haproxy/errors/503-no-octoprint.http

backend octoprint
        reqrep ^([^\ :]*)\ /(.*) \1\ /\2
        reqadd X-Scheme:\ https if { ssl_fc }
        option forwardfor
        server octoprint1

backend octoprint2
	 reqrep ^([^\ :]*)\ /(.*) \1\ /\2
	 reqadd X-Scheme:\ https if { ssl_fc }
	 option forwardfor
	 server octoprint2

backend webcam
        reqrep ^([^\ :]*)\ /webcam/(.*)     \1\ /\2
        server webcam1

backend webcam2
        reqrep ^([^\ :]*)\ /webcam2/(.*)     \1\ /\2
        server webcam1
        errorfile 503 /etc/haproxy/errors/503-no-webcam.http

backend webcamstream
        reqrep ^([^\ :]*)\ /(.*)   \1\ /\?action=stream
        server webcam1

webcam2 is set to 8082 instead fo 8080 like the above url states

Also...make sure to change your pi's login password and secure your octoprint with a good password also so if someone does happen on it you got something.


The two things I would suggest in this case is to either port forward from a different external port, or simply use a VPN solution.

VPN is the best, as you are not allowing the pis access from the outside. If VPN is not a solution for you then you can do an outside port forward from say 81 to inside port 80.
Assuming your outside IP address was, pi 1 was and pi two was, you would enable port 80 to port 81, and port 82 to port 80. You can then access them via and It seems complicated, but it is not.


It seems @Zoombee beat me to a reply. That is a different solution. A fourth solution I just realized was to use something like octoprint anywhere. There are multiple ways to do this. Pick your poison!


Also, to rid of having to remember the ip, you can use a service like to get a sudo domain name.


I've updated my method to reduce open ports to one while still being able to goto octoprint, /webcam and /webcam/?action=stream

I put it all in a post in guides where I also point out what I did different from the guide I posted above.
Guide:Setting up OctoPrint on a Raspberry Pi for multiple printers