Answers
将
/etc/nginx/conf.d/myapp.conf
中的9090将为8000,然后将
server 8000
改为别的端口,如80端口。
然后为了显示图片、js、css,需要下面的配置
location /static/ {
alias /home/www/MK_dream/MK_dream/static;
if ($query_string) {
expires max;
}
expires 30d;
}
location /static/media/ {
alias /home/www/MK_dream/MK_dream/static/media;
if ($query_string) {
expires max;
}
expires 30d;
}
location ~* ^.+\.(cur|ico|json|gif|jpeg|cur|jpg|png|ttf|otf|js|css|mpg|avi|mp3|swf|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|txt|tar|mid|midi|wav|rtf|mpeg|woff)$ {
root /home/www/MK_dream/MK_dream/;
expires 30d;
access_log off;
}
如果配置成功,建议可以使用
gunicorn
替换
uwsgi
,性能更好。
vodevil
answered 10 years, 4 months ago