I am playing with DMZ forwarding from my router to my first Nano. I don't know if I will stick with this or not, I am going to start exploring port forwardiing from my router to my various Nanos.
So right now http://public-ip:80 will go straight to antman. Is there a way to change antman to some other random port, and maybe hookup port:80 of my nano1 public IP directly into an antlet?
Like I said, maybe with my setup of several nanos living behind a single router, and port forwarding, it wont matter what port AntMan is on.
But I was thinking about getting some extra IP address from Comcast (the extra cost probably outweighs what I am saving on virtual machines with a cluster of nanos), but if I do that, then I would want to expose the nanos to the world to consume the additional IPs with no routers in front of them. In which case, I definitely wouldn't want AntMan to be on all their port 80's.
OK. So this is a significant problem.
In my router I have forwarded:
- http://public-ip:1031 to port http://nano1.local:80 to get to the antman on my first nano. (which is my DMZ server)
- http://public-ip:1032 to port http://nano2.local:80 to get to the antman on my 2nd nano
- http://public-ip:1033 to port http://nano3.local:80 to get to the antman on my 3rd nano
When I go to http://public-ip:1031 I get a login, which works, but I end up at http://public-ip (because public port 80 DMZs to port 80 on the first nano1.local). I can browse antman. I can even add :1031 to the url, and it still works and then stays on port 1031
When I try http://public-ip:1032 I get a login prompt from nano2. but as soon as I login, I am redirected to http://public-ip which is the first nano. That is not where I want to be.
If the login page would not lose the port it was served on, this just might work. Otherwise, apparently I need to be able to explicitly change the port of antman.
And will also need to set the port the web based console runs on, so each nano can be reached from port forwarding. Right now the web based console runs on port 6880.
A workaround is to console into the first nano, then ssh into either of the two other nanos.
OK, so I setup 3 more port forwardings, each to port 3000 on each nano.
publicIP:3000 to nano1:3000 - login works fine. - I end up at publicIP:3000 "nano1 | antMan". Click around look at some different screens, everything ok.
now I login on the second one publicIP:3001 - I get logged in, briefly see nano2, but then both browser tabs log out!
I tried opening publicIP:3001 in an incognito window to nano2, and it opened, and nano1 didn't get logged out.
But trying to open publicIP:3002 got the login screen, but as soon as I open nano3, both nano2 and nano3 get logged out.. Apparently incognitio windows share cookies?
OK, so three different browsers, one for each nano.... OK.... Chrome regular, chrome incognito, and firefox, cool have them all three open at the same time with browser consoles to each one at the same time too.
So perhaps it is just the cookies that are getting in the way.
Pretty cool! Thank you.