I am running a computer at a very remote site (6 hours away), and I would like to control it remotely. For security, I would like to block everything except port 22 from the outside world. I need to run a web server, and I need access to the IPMI port to control the server remotely. My plan is to use ssh port forwarding to port 80 for the web server and 443 to the IPMI port.
I have set up ufw to forward port 443 to the IPMI address. Port 80 just goes to the web server.
I am able to load the web page on port 80 with ssh port forwarding. However, when I use ssh port forwarding to port 443, the connection is refused. If I unblock 443 on ufw and connect directly, I can connect to the IPMI interface with no problems. So, it seems I cannot use ssh port forwarding to a port that is forwarded by ufw.
Does anyone have any advice? I should say I am no expert on ufw, so I am hoping there are some experts who know of a way around this problem.
I am running Ubuntu 18.04 in case that matters.