uwsgi is swiss-army-knife of web apps. It can work in so many different ways. One easiest way get started is running it as a http server and expose it via nginx using mod_proxy. (This may not be the best approach, but surely the easiest to get started.)
# python code, say hello.py
import web
urls = (
'/', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self):
return 'Hello, world!\n'
# uwsgi expects a variable with name `application`
application = app.wsgifunc()
if __name__ == "__main__":
app.run()
Now run uwsgi server.
I'm using a virtualenv here and I've specified that with -H option. (if you are not using virtualenv, I strongly recommend you to use it).
--wsgi option specified the wsgi module name, -p4 indicates that we want to run 4 workers.
--http indicates that we want to run uwsgi as a http server.
Now you can configure nginx to proxy this server.
If you want to run uwsgi as fastcgi-server, use --fastcgi-socket instead of --http.
If you've nginx server is configured with uwsgi support, then you can specify --socket to make it speak its default custom protocol.
Anand