Score:0

ubuntu server nginx not working ufw configured

cn flag

I have fresh installation of Ubuntu server 22.04. I can't connect to my docker container. Here is some more information:

ufw status

Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
80                         ALLOW       Anywhere                  
22 (v6)                    ALLOW       Anywhere (v6)             
80 (v6)                    ALLOW       Anywhere (v6)             

docker ps

CONTAINER ID   IMAGE     COMMAND                  CREATED       STATUS         PORTS                               NAMES
96c1479b1a2c   nginx     "/docker-entrypoint.…"   2 hours ago   Up 5 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp   nginx-container

curl localhost and curl 192.168.0.134 (from same server)

<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

curl 192.168.0.134 from device which I use to ssh access:

curl: (28) Failed to connect to 192.168.0.134 port 80 after 25916 ms: Operation timed out

same problem on browser (Chrome)

ping from host to server working:

ping 192.168.0.134
PING 192.168.0.134 (192.168.0.134): 56 data bytes
64 bytes from 192.168.0.134: icmp_seq=0 ttl=64 time=2.039 ms
64 bytes from 192.168.0.134: icmp_seq=1 ttl=64 time=2.225 ms
64 bytes from 192.168.0.134: icmp_seq=2 ttl=64 time=3.588 ms

Any idea? In my opinion, docker and ufw is configured properly, I hope my router is not blocking anything (host is laptop with wifi, server is connected by cable, ssh working properly so devices have connection probably)

in flag
A timeout usually points toward a firewall issue. Check if there is another firewall involved.
sosnus avatar
cn flag
This is fresh, Ubuntu server. Usually I working with standard Ubuntu desktop and I do not have problem like this. Do You know what could be name of Ubuntu preinstalled firewall?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.