It is possible to deploy web.py with nginx using a mod_wsgi similar to the module for Apache.

After compiling and installing nginx with mod_wsgi, you can easily get a web.py app up and running with the following config* (edit the paths and settings with your own):

wsgi_python_executable  /usr/bin/python;

server {
    listen 80;
    server_name www.domain_name.com domain_name.com;
    root /path/to/your/webpy;

    include /etc/nginx/wsgi_vars;
    location / {
        wsgi_pass /path/to/your/webpy/app.py;     
     }
}

*Note: This is a snippet of the relevant information to setup mod_wsgi for your web app and NOT a full config for running nginx.

Helpful links:
nginx website
wiki page on mod_wsgi


由于博客空间在国外,所以有时会造成不稳定(你懂滴),如果您觉得我的博文对您有帮助, 建议大家多使用RSS访问阅读,本站所有文章均已全文输出。
鲜果阅读器订阅图标

Fork me on GitHub