This is just about the iptables rules.
it has a deny any to any rule which is in the last line of iptabels rules and the thing is when we open port 443 it goes after the deny any to any rule so it won't work. the solution is that you delete that deny any to any rule at first, then write a rule to open the 443 port and then write the deny any to any as it was before and the problem will be solved.
sudo iptables -D INPUT -j REJECT --reject-with icmp-host-prohibited
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited
sudo iptables-save
sudo systemctl restart iptables
This will help for sure.
peace