Ubuntu – Cannot connect on port 80 to Azure Ubuntu machine

azureiptablesUbuntu

I have recently set up a Linux Ubuntu VM on Azure.

I can SSH into the machine just fine, but HTTP requests are answered with "Connection refused".

I have:

  1. Set up an Endpoint for port 80 in the Azure Management Portal.

  2. Edited the iptables to ACCEPT incoming tcp on port 80.

  3. Made sure my little Ruby app is indeed running, and running on port 80 (by curl to http://localhost)

Is there anything else I need to for the server to answer incoming HTTP requests on port 80? Both requests to the http://servicename.cloudapp.net and public virtual IP address fails in the same way.

Best Answer

I figured out the problem. Using the Ruby Sinatra framework, I had to specify the IP address to bind to in the application code, otherwise the HTTP server only listens to calls to localhost.