nginx virtuanenv django1.4 应用简单部署

nginx配置文件

server {


listen 80;
server_name helloworld.square0083.com;


access_log /var/log/nginx/helloworld.square0083.com-access.log;
error_log /var/log/nginx/helloworld.square0083.com-error.log;

location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8000;
uwsgi_param UWSGI_PYHOME /home/xxxx/xxxx_en;  # 此处为virtualenv的目录
uwsgi_param UWSGI_CHDIR /home/xxxx/appliation_dir_root;  # 此处为应用根目录
uwsgi_param UWSGI_SCRIPT helloworld.wsgi; #  Django应用下的wsgi模块
}

# 配置资源
location ^~ /static {
alias /home/xxxx/application_dir_root/static; 
}

location ^~ /media {
alias /home/xxxx/application_dir_root/media; 
}

uwsgi启动

uwsgi -s :8000 -M -p 4 --vhost --no-site


你可能感兴趣的:(nginx,django,virtualenv)