Nginx+uwsgi+Django (Python web环境)
# vi /application/nginx/conf/nginx.confuserroot;
worker_processes1;
events {
worker_connections1024;
}
#}
http {
include mime.types;
default_typeapplication/octet-stream;
sendfile on;
keepalive_timeout65;
upstream django {
server unix:///tmp/project.sock; # for a file socket
}
server {
listen 80;
server_nameda.yilongzc.com;
location/static {
alias /root/shell/DataShow/static; # your Django project's static files - amend as required
send_timeout 500;
proxy_read_timeout 500;
proxy_connect_timeout 500;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
root /root/shell/DataShow/;
if (-f $request_filename) {
expires 1d;
break;
}
}
location ~ .*\.(js|css)$
{
root /root/shell/DataShow/;
if (-f $request_filename) {
expires 1d;
break;
}
}
location / {
uwsgi_send_timeout 500;
uwsgi_connect_timeout 500;
proxy_read_timeout 500;
uwsgi_read_timeout 500;
uwsgi_ignore_client_abort on;
uwsgi_passdjango;
include uwsgi_params;
}
}
}
页:
[1]