librelist archives

« back to archive

How to configure flask app for Ubuntu server

How to configure flask app for Ubuntu server

From:
Kundan Singh
Date:
2013-05-06 @ 14:34
I have installed Nginx, uWSGI in a Ubuntu x32 server. I have created a
virtual env folder at /srv/www/helloworld and installed flask into that.
Created a single file application.py app into that folder.

Now i don't know how to configure Nginx to run that Flask app at my
domainname.com (Earlier i tried a basic html page website and it worked
fine with Nginx) But no idea about configuring uWSGI or Nginx to run on
ubuntu.

I tried following article at
http://blog.kramerapps.com/post/22551999777/flask-uwsgi-nginx-ubuntu
but still no luck.

Can you give me some good tutorial or advice to follow on how to deploy and
run a flask app on Nginx & Ubuntu?

Regards

Re: [flask] How to configure flask app for Ubuntu server

From:
Shawn Milochik
Date:
2013-05-06 @ 14:59
For a simple use-case (no SSL), you just run your Flask app an whatever
user you like and remember the port it's listening on. Make sure it's just
listening on localhost -- not on a public interface. I recommend using
gunicorn, and control gunicorn with supervisord.

Then the nginx config just looks like this (assuming port 9999):

    location / {
        proxy_pass http://127.0.0.1:9999;
    }

Re: [flask] How to configure flask app for Ubuntu server

From:
薛 鹏飞
Date:
2013-05-07 @ 00:18
take a look at this link, 
https://github.com/pengfei-xue/openshift-flask-mongdb/tree/master/box

there are three files, nginx.conf uwsgi.ini and application.py, I think 
nginx.conf and uwsgi.ini is what you want

--
Sincerely,
Pengfei Xue
https://life-map.rhcloud.com

在 2013-5-6,下午10:34,Kundan Singh <ksingh.pilani@gmail.com> 写道:

> I have installed Nginx, uWSGI in a Ubuntu x32 server. I have created a 
virtual env folder at /srv/www/helloworld and installed flask into that. 
Created a single file application.py app into that folder.
> 
> Now i don't know how to configure Nginx to run that Flask app at my 
domainname.com (Earlier i tried a basic html page website and it worked 
fine with Nginx) But no idea about configuring uWSGI or Nginx to run on 
ubuntu.
> 
> I tried following article at 
http://blog.kramerapps.com/post/22551999777/flask-uwsgi-nginx-ubuntu
> but still no luck.
> 
> Can you give me some good tutorial or advice to follow on how to deploy 
and run a flask app on Nginx & Ubuntu?
> 
> Regards