title: Cannot hit simple node web server hosted on EC2 instance
body: <p>Not able to hit my simple node web server hosted on an ubuntu EC2 in AWS.  But I can't see I've missed anything!  I've provided screen shots below within AWS - What am I missing?  Please help!.
  Many thanks,</p>
  
  <p><strong>Node code</strong></p>
  
  <pre><code>const http = require('http');
  
  const hostname = '127.0.0.1';
  const port = 8080;
  
  const server = http.createServer((req, res) =&gt; {
    res.statusCode = 200;
    res.setHeader('Content-Type', 'text/plain');
    res.end('Hello World\n');
  });
  
  server.listen(port, hostname, () =&gt; {
    console.log(`Server running at http://${hostname}:${port}/`);
  });
  </code></pre>
  
  <p><strong>Command prompt</strong></p>
  
  <pre><code>$ node index.js 
  </code></pre>
  
  <p><strong>Command prompt response</strong></p>
  
  <pre><code>Server running at http://127.0.0.1:8080/
  </code></pre>
  
  <p><strong>EC2 instance</strong></p>
  
  <p><a href="https://i.stack.imgur.com/605KP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/605KP.png" alt="ec2 settings"></a></p>
  
  <p><strong>Security settings</strong></p>
  
  <p><a href="https://i.stack.imgur.com/3jkdF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3jkdF.png" alt="security settings"></a></p>
  
  <p><strong>Elastic IP settings</strong></p>
  
  <p><a href="https://i.stack.imgur.com/9QPWI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9QPWI.png" alt="enter image description here"></a></p>
  
  <p><strong>Browser</strong></p>
  
  <pre><code>http://"Public DNS (IPv4) value":8080/ 
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p><a href="https://i.stack.imgur.com/uICLc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uICLc.png" alt="enter image description here"></a></p>