unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.45k stars 686 forks source link

Application dictionary not works as expected #1163

Open mbande opened 8 years ago

mbande commented 8 years ago

i have a wsgi.py file like this:

import uwsgi

def foo(environ, start_response):
  # do something
  start_response('200 OK', [('Content-Type', 'text/plain')])
  yield 'Foo Done\n'

def bar(environ, start_response):
  # do something
  start_response('200 OK', [('Content-Type', 'text/plain')])
  yield 'Bar Done\n'

uwsgi.applications = {
  '/foo':foo, 
  '/bar':bar
}

and uwsgi.ini file is like this:

[uwsgi]

socket      = :9090
venv        = /root/.venv/python2.7
chdir           = /root/project
module      = wsgi
master          = true
processes       = 2
threads     = 2
chmod-socket    = 777
uid         = uwsgi
gid         = uwsgi
pidfile     = /run/uwsgi/uwsgi.pid
daemonize   = /var/log/uwsgi.log

and run this behind Nginx proxy, passing all requests to uwsgi but no matter what is the request path, always the foo application runs, even in the root path. i use the latest 2.0.12 version

xrmx commented 8 years ago

Reproducible with a smaller config:

[uwsgi]
plugins = python, http
processes = 1
http = :8000
module = wsgi
juansaavedrauy commented 4 years ago

I can reproduce this in the latest version. It picks the first application in the dict.

IvesFeng commented 3 years ago

I'm having this problem too, no one has an answer?