title: Forwarding Nginx port to gunicorn instance
body: <p>I was following this tutorial to setup my flask server. </p>
  
  <p><a href="https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04#step-6-%E2%80%94-securing-the-application" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04#step-6-%E2%80%94-securing-the-application</a></p>
  
  <p>When I got to step 6 I see that they are setting flask for the whole url but I would like to point it to a specific port. </p>
  
  <p>This is the code I have for my nginx which points. This currenly produces a 404.</p>
  
  <pre><code>server {
          listen 5000;
          server_name site.com;
  
          location / {
                  include proxy_params;
                  proxy_pass http://unix:/home/user/project/project.sock;
          }
  }
  </code></pre>
  
  <p>All the other files are the same as the tutorial. I have tried to modify the .sock file but it seems like it was generated automatically and it can't be modified. In addition I need to find a way for nginx to handle this before I worry about handling it from gunicorn. </p>
  
  <p>My end goal is to have nginx foward requests to flask running when a request is sent to <code>0.0.0.0:5000</code> and have all other requests <code>0.0.0.0 , 0.0.0.0/*</code> be handled by nginx. </p>
  
  <p>Any help to undestand all this is really appreciated got lost at this point. </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>my nginx configuration in sites-available</p>
  
  <pre><code>server {
       server_name domain www.domain; 
       location / {
           include proxy_params; 
           proxy_pass http://127.0.0.1:8080/; 
       }
  }
  </code></pre>