1

Weird issue I'm facing currently! There is nothing running on port 80.

Still curl gives 404 page not found. I can telnet to port 80 and even start a container exposing port 80 (host). But no requests reaches the container!

Any idea what might be going on? How do I debug this?

$ netstat -tulpn | grep :80
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::8000                 :::*                    LISTEN      -                   
$ curl localhost
404 page not found
2
  • 6
    Please provide output of iptables -vnL -t nat or nft list ruleset ip as theres possibly a internal nat redirect causing that behaviour. Sep 8, 2021 at 9:44
  • 1
    It was indeed because of iptables rule. I had installed k3s which configures some iptables rules. Uninstalling it solved the issue.
    – Shinto C V
    Sep 9, 2021 at 10:51

1 Answer 1

2

In addition to Matthew's comment suspecting internal nat redirect

  • iptables -vnL -t nat or nft list ruleset ip

perhaps you could directly inspect port 80. These are some of the ways to do that:

  • ss -4tlnp -o state LISTENING '( sport = :80 )'
  • lsof -i:80
  • do a verbose tcpdump
  • do a verbose portscan with nmap
  • or, be even more explicit when testing with curl, ie curl -v http://localhost:80
1
  • 1
    I would add curl with -v option to the top of this list.
    – Tomek
    Sep 9, 2021 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.