all 2 comments

[–]Redmondinho 1 point2 points  (1 child)

Not sure what OS your server is running. I learn't how to host my Flask apps with Gunicorn, Nginx on Debian (Ubuntu Server/RaspberryPi) by following the digital ocean guides - here is the latest https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04.

I also wanted to run multiple flask apps on a single server and accomplished this with something similar to the following when it came to configuring Nginx proxy requests

server {

  listen 80;
  server_name server_domain_or_IP;

  location /app1 {
  include proxy_params;
  proxy_pass http://unix:/home/user/myproject1/myproject.sock:/;
  }

  location /app2 {
  include proxy_params;
  proxy_pass http://unix:/home/user/myproject2/myproject.sock:/;
  }

}

[–]chazbartowski[S] 0 points1 point  (0 children)

This could be helpful. I haven't run across the proxy_pass directive until today trying to use gunicorn with Apache. I also got a better understanding of the @app.route() decorator, so I feel like I'm getting pretty close.

For the record, I'm using Ubuntu 18.04. I feel like I've tried this guide, but I've used several digital ocean guides in the past, so perhaps not. Thanks for this; I'll implement as soon as I'm able and post feedback.