Nginx gunicorn flask

Hey @jarod5001 ,

I was able to solve my problem while trying to reinstall the app.

  1. I installed the “my_webapp” app through Yunohost.

  2. I created a dummy Flask app with the route:

    @app.route('/site/flaskapp')
    
  3. I started Gunicorn:

    gunicorn --bind 0.0.0.0:8000 app:app
    
  4. Configuring Nginx was actually easy:
    In /etc/nginx/conf.d/gunicorn.rogues.fr.d/my_webapp.d/flaskapp.conf I wrote:

    location /site/flaskapp {
        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;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
    
  5. Then I restarted Nginx:

    sudo systemctl restart nginx
    

And the app is ONLINE! :partying_face:

Now I will concentrate on installing my own bank prediction app.

Thank you !!!

1 Like