networking – I have to type in port 80 after my website to see it (www.example.com:80 – but only with ssl)

I am new to server management and decided to learn by deploying my own website 😀

The problem is probably that I misconfigured iptables / didn’t configure them enough.

I have a node app running on port 8080 (https server, certificates are working well)

I ran sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
to reroute all traffic that goes into the 80 port to go to 8080 – that worked for the normal http server -> I could go to www.example.com without issue.

tcptracerroute

tcptraceroute 159... 80
Selected device lo, address 159, port 35499 for outgoing packets
Tracing the path to 159 on TCP port 80 (http), 30 hops max
 1  ubuntu-main (159) (closed)  0.178 ms  0.064 ms  0.142 ms

(If it would help I can give the domain name / ip address)

netstat -ltnp

(sudo) password for twiggeh: 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      531/systemd-resolve 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      675/sshd: /usr/sbin 
tcp        0      0 127.0.0.1:42143         0.0.0.0:*               LISTEN      950/node            
tcp6       0      0 :::22                   :::*                    LISTEN      675/sshd: /usr/sbin 
tcp6       0      0 :::8080                 :::*                    LISTEN      1279/node   

iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination