我正在尝试使用 Nginx + Gunicorn 和主管在 Lion 中设置 Django。我已经安装了:
进度:MySQL DMG + MySQLdb 编译 + Python + brew nginx + easy_install gunicorn + pip install Django + easy_install supervisor。
当前配置详细信息:
Nginx:
upstream app_server {
server unix:/tmp/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
#Static
root /Users/andre/sites;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
Gunicorn:你可以看到这里
Supervisor:
[program:gunicorn]
command=/usr/local/bin/gunicorn main:application -c /Users/devepy/desktop/andre/andre/gunicorn.conf.py
directory=/Users/andre/desktop/andre/myproject
user=nobody
autostart=true
autorestart=true
redirect_stderr=True
实际上我不知道还能做什么,但花了几个星期才知道 mac osx 很疯狂。