Not able to access port 80 on my Ubuntu 22.04 Azure VM

RITAM BARMAN 20 Reputation points
2023-05-11T10:00:03.79+00:00

I have added port 80 HTTP and port 443 HTTPS in my inbound network rules, but when I try to open a connection on port 80 it says Permission denied or when I try to do curl localhost:80 on my VM it says curl: (7) Failed to connect to localhost port 80 after 0 ms: Connection refused.

I have tried everything like removing the port from inbound rules and restarting the VM still it doesn't help. Also my UFW is also inactive so it's not a problem from that also. Add when I use netstat to see if anything is running on port 80 it says Port 80 is not available.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,585 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,311 questions
{count} votes

Accepted answer
  1. Olaf Helper 43,246 Reputation points
    2023-05-11T10:35:07.2266667+00:00

    You mis-intpret the messages.

    If the port would be blocked by Firewall, then you get not connectio at all and after 30 seconds you get a timeout error.

    But you get "permission denied" and that means, the conection was successful, but you as user don't permissions to access the web server.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful