web.py nginx uwsgi

web.py nginx uwsgi

nginx.conf  server部分配置

 

 server

{

listen  9191;  

server_name t.com;  

location / {  

uwsgi_pass   127.0.0.1:9192;  

include     uwsgi_params;  

access_log  off;  

}  

 }      

cd /var/www/webpy

vi index.py

#!/usr/bin/python

# -*- coding: utf-8 -*-

 

import web 

 

urls = ("/.*", "hello")

 

class hello:

    def GET(self):

        return 'Hello, world!'

 

app = web.application(urls, globals())

application = app.wsgifunc()


 

uwsgi -s 127.0.0.1:9192 -w index

 

访问  http://localhost:9191

 

posted @ 2013-06-06 12:41  顶顶顶顶  阅读(197)  评论(0)    收藏  举报