title: How to start uwsgi with flask and nginx
body: <p>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:</p>
  
  <pre><code>--manage.py ( Flask's Script extension script)
  --app/   ( application folder as a package)
  --virtual_env
  </code></pre>
  
  <p>and not sure what all i messed up, but now when i try whatever with uwsgi command , it says following error : </p>
  
  <pre><code>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 ***
  </code></pre>
  
  <p>EDIT:
  starting it like this worked: </p>
  
  <p><code>uwsgi --http :9090 -w manage:app --enable-threads</code></p>
  
  <p>this worked ... in manage.py i had  line:
  <code>app=create_app('default')</code>
  so that was pretty much all i guess i needed to do...</p>
  
  <p>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?</p>
  
  <p>this is just created /etc/nginx/nginx.conf file </p>
  
  <pre><code>    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;
  
      }
  }
  </code></pre>
  
  <p>}</p>