Q:

How to make nginx serve a public ip

Background
I'm sick of slack being too expensive, so I decided to replace it with mattermost. I got an AWS ubuntu box with a public IP, and followed the mattermost installation instructions (the main difference is that I'm running everything on the same server, as opposed to having a separate db server and storage server etc.. they're all running on the same machine ie http://127.0.0.1) 
My domain (lobolabshq.com) is managed by wix, and so I added a subdomain: mattermost.lobolabshq.com
I installed the mattermost server on the AWS box, and then I setup nginx to proxy the requests to the nginx server. My nginx proxy config is stored in /etc/nginx/sites-available/mattermost and looks like this:
upstream backend {
    server 127.0.0.1:8065;
}

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;

server {
    listen 80;
    server_name    mattermost.lobolabshq.com;

    location /api/v3/users/websocket {
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        client_max_body_size 50M;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Frame-Options SAMEORIGIN;
        proxy_buffers 256 16k;
        proxy_buffer_size 16k;
        proxy_read_timeout 600s;
        proxy_pass http://backend;
    }

    location / {
        client_max_body_size 50M;
        proxy_set_header Connection "";
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Frame-Options SAMEORIGIN;
        proxy_buffers 256 16k;
        proxy_buffer_size 16k;
        proxy_read_timeout 600s;
        proxy_cache mattermost_cache;
        proxy_cache_revalidate on;
        proxy_cache_min_uses 2;
        proxy_cache_use_stale timeout;
        proxy_cache_lock on;
        proxy_pass http://backend;
    }
}

Problem
When I go to http://mattermost.lobolabshq.com it returns this error:

Network Error (tcp_error) 
A communication error occurred: "Operation timed out" The Web Server
  may be down, too busy, or experiencing other problems preventing it
  from responding to requests. You may wish to try again at a later
  time.

Analysis/What I have tried
mattermost server runs fine locally
I do know that my mattermost server is running just fine locally, because according to the docs when I run curl http://127.0.0.01:8065 it returns the mattermost welcome page
nginx server successfully reroutes requests to :80 port
I do know nginx is running fine, b/c when I run curl http://localhost or curl http://127.0.0.1 I also get the same mattermost welcome page.
domain is pointing to AWS machine
I do know that http://mattermost.lobolabshq.com also points to my aws box public ip:
dig mattermost.lobolabshq.com

; <<>> DiG 9.8.3-P1 <<>> mattermost.lobolabshq.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62124
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mattermost.lobolabshq.com. IN  A

;; ANSWER SECTION:
mattermost.lobolabshq.com. 1800 IN  A   54.165.78.199

netstat output
sudo netstat -anp | grep tcp
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1803/nginx -g daemo
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1134/sshd
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      1249/postgres
tcp        0      0 172.31.50.32:22         185.81.141.147:54411    ESTABLISHED 1860/sshd: ubuntu [
tcp        0     72 172.31.50.32:22         185.81.141.147:60344    ESTABLISHED 1603/sshd: ubuntu [
tcp6       0      0 :::22                   :::*                    LISTEN      1134/sshd
tcp6       0      0 :::8065                 :::*

outside requests are NOT making it to ngix
when i run curl localhost locally my nginx access logs get updated:
127.0.0.1 - - [18/Jan/2017:06:41:09 +0000] "GET / HTTP/1.1" 200 2246 "-" "curl/7.47.0"

but I don't get such an entry when I hit mattermost.lobolabshq.com from the browser

A:

I simply had to update the security group that my aws box was a part of, and allow all incoming TCP connections at port 80 to work

