#user nobody; worker_processes 10; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format access '{"ip":"$remote_addr", "time":"[$time_iso8601]" ,"path":"$request","infosoruce":"$http_user_agent"}'; #access_log logs/ip.log access; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; gzip on; client_max_body_size 8M; client_body_buffer_size 128k; upstream mysvr { server 127.0.0.1:8002; } server { # 端口和域名 listen 8000; server_name 127.0.0.1; # 日志 access_log /label/iepy-develop/examples/coreline/log/gunicorn_access.log; error_log /label/iepy-develop/examples/coreline/log/gunicorn_error.log; # 不记录访问不到 favicon.ico 的报错日志 #location = /favicon.ico { access_log off; log_not_found off; } location /static/ { root /label/iepy-develop/iepy/webui; } location /media/ { root /home/wardseptember/django-blog; } # gunicorn 中生成的文件的地址 location / { proxy_pass http://mysvr; #请求转向mysvr 定义的服务器列表 } } }