title: Cannot reach nginx on ubuntu AWS EC2 server
body: <p>I'm trying to launch a Python webapp, doing the same as I usually do (not that I totally know what I'm doing). Usually I see a "Bad Gateway" when I'm running nginx on the server and I go to the IP in my browser. For whatever reason, I'm just getting timed out right now.</p>
  
  <p>edit: im expecting a Bad Gateway, im getting nothing</p>
  
  <p>Thanks in advance,</p>
  
  <p>I haven't done anything with the default config file...
  My <code>etc/nginx/sites-available/default</code> looks like this </p>
  
  <pre><code>server {
      listen 80;
      server_name ec2-52-36-167-131.us-west-2.compute.amazonaws.com;
      access_log  /var/log/nginx/test.log;
  
      location / {
          proxy_pass http://127.0.0.1:8000/;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }
  }
  
  </code></pre>
  
  <p><code>sudo service nginx status</code> looks like this</p>
  
  <pre><code>● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2020-06-19 02:06:09 UTC; 8s ago
       Docs: man:nginx(8)
    Process: 9149 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
    Process: 9161 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 9152 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 9162 (nginx)
      Tasks: 2 (limit: 1152)
     CGroup: /system.slice/nginx.service
             ├─9162 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             └─9163 nginx: worker process
  
  Jun 19 02:06:09 ip-172-31-25-6 systemd[1]: Stopped A high performance web server and a reverse proxy server.
  Jun 19 02:06:09 ip-172-31-25-6 systemd[1]: Starting A high performance web server and a reverse proxy server...
  Jun 19 02:06:09 ip-172-31-25-6 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
  Jun 19 02:06:09 ip-172-31-25-6 systemd[1]: Started A high performance web server and a reverse proxy server.
  
  </code></pre>
  
  <p>When I <code>curl -I ec2-52-36-167-131.us-west-2.compute.amazonaws.com</code> on the server I get the bad gateway I'm expecting, but on my local machine I get a timeout. </p>