I guess my main problem is that i don't know, how file hierarchy should look like ? So far i was following Grinberg's tutorial in his "Flask development" book. So i have like:
--manage.py ( Flask's Script extension script)
--app/ ( application folder as a package)
--virtual_env
and not sure what all i messed up, but now when i try whatever with uwsgi command , it says following error :
current working directory: /home/gaucan/temp/my_app
detected binary path: /usr/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
EDIT: starting it like this worked:
uwsgi --http :9090 -w manage:app --enable-threads
this worked ... in manage.py i had line:
app=create_app('default')
so that was pretty much all i guess i needed to do...
but i still cant get anyhow get rid of warning above... that i am running uwsgi without its master process manager... is it OK ? or have i done wrong something?
this is just created /etc/nginx/nginx.conf file
worker_processes 1;
events {
worker_connections 1024;
}
http {
sendfile on;
gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/xml text/css
text/comma-separated-values
text/javascript
application/x-javascript
application/atom+xml;
# Configuration containing list of application servers
upstream uwsgicluster {
server 127.0.0.1:8080;
# server 127.0.0.1:8081;
# ..
# .
}
# Configuration for Nginx
server {
# Running port
listen 80;
# Settings to by-pass for static files
location ^~ /static/ {
# Example:
# root /full/path/to/application/static/file/dir;
root /app/static/;
}
# Serve a static file (ex. favico) outside static dir.
location = /favico.ico {
root /app/favico.ico;
}
# Proxying connections to application servers
location / {
include uwsgi_params;
uwsgi_pass uwsgicluster;
proxy_redirect off;
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-Host $server_name;
}
}
}