nginx1配置文件
1,查看日志:cat /usr/local/nginx/logs/error.log
2,编辑配置文件:vi /usr/local/nginx/conf/nginx.conf
3,内容:server {
listen 8080;
server_name localhost;
location / {
root /project/templates;
index index.html
allow all;
}
location /static/ {
alias /home/django_project/static/;
allow all;
}
location /static { #同本地settings.py中STATIC_URL='/static/'
alias /django_project/static/; #STATICFILES_DIRS=(os.path.join(BASE_DIR,"STATIC"),)
index index.html index.html;
}
4,修改完配置文件重新加载:/usr/local/nginx/sbin/nginx -s reload
5,nginx指定配置文件启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
6,启动uwsgi:
项目内根目录,删掉test.py,执行uwsgi -ini(--ini?) cmdb_uwsgi.ini & /usr/local/nginx/sbin/nginx