How can I hide :8080 in the URL?

I tried hiding port 8080 in the URL by enabling iptables on Ubuntu 14.04 and using without any luck:

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

I’d also like to forward http to https, what’s the easiest way to go about this?

I’m not very experienced with server setups, but thanks if someone does help :smile:

P.S. Is there a way to hide the password on the login page by default?


I tried the first command “iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to” and restarted the server, but it still doesn’t forward.

Also, another self hosted app that I use (Shout IRC) was able to work with the port redirect “sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080” but for some reason it just doesn’t work for MineOS.

Https uses 443 normally…

1 Like

I added the HTTPS terminal command in the post as well, same result

Can you show me exactly what you put in for your https entry please. Also, are you running this on your MineOS machine?

Exactly as the example, unless I was meant to change a part of it. I did say I wasn’t too experienced with this. I ran the command on the same VPS that’s got MineOS on it; which is Ubuntu 14.04 LTS on a Windows Azure VPS. :smile:

Ok, you need to change 8443 to 8080. That should fix it I think

Added “iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to” and restarted the server, no luck.

Also, do you know where I can change the port 8080 to 80 in the MineOS configs?

Oh, you need to save the rules, you can’t type it then restart because you’ll lose it. just type it in and test it. if it works you need to save the iptables rules (you can google that).
Are you wanting to change it from HTTPS to HTTP or just change the port to 80?

It didn’t work, and I just want to change it to 80 so I can type instead of

From start to finish, here’s how you can set it up without the port number in the URL:

# vi /etc/mineos.conf
[ change port 8080 to 443 in config ]
# iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
# iptables -D INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
[ test web-ui connectivity here, and if successful, commit the iptables rules ]
# iptables-save > /etc/iptables-rules

For good measure, after successfully logging in to the server with the URL: https://ipaddress (without port), restart your server, to ensure firewall rules, etc. are all committed properly.

Note, this doesn’t utilize the iptables’ PREROUTING directive, but in this case, prerouting is overkill for the sake of getting your goal of a port-free URL.