nginx.conf 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #user nobody;
  2. worker_processes 10;
  3. #error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. #error_log logs/error.log info;
  6. #pid logs/nginx.pid;
  7. events {
  8. worker_connections 1024;
  9. }
  10. http {
  11. include mime.types;
  12. default_type application/octet-stream;
  13. log_format access '{"ip":"$remote_addr", "time":"[$time_iso8601]" ,"path":"$request","infosoruce":"$http_user_agent"}';
  14. #access_log logs/ip.log access;
  15. sendfile on;
  16. #tcp_nopush on;
  17. #keepalive_timeout 0;
  18. keepalive_timeout 65;
  19. gzip on;
  20. client_max_body_size 8M;
  21. client_body_buffer_size 128k;
  22. upstream mysvr {
  23. server 127.0.0.1:8002;
  24. }
  25. server {
  26. # 端口和域名
  27. listen 8000;
  28. server_name 127.0.0.1;
  29. # 日志
  30. access_log /label/iepy-develop/examples/coreline/log/gunicorn_access.log;
  31. error_log /label/iepy-develop/examples/coreline/log/gunicorn_error.log;
  32. # 不记录访问不到 favicon.ico 的报错日志
  33. #location = /favicon.ico { access_log off; log_not_found off; }
  34. location /static/ {
  35. root /label/iepy-develop/iepy/webui;
  36. }
  37. location /media/ {
  38. root /home/wardseptember/django-blog;
  39. }
  40. # gunicorn 中生成的文件的地址
  41. location / {
  42. proxy_pass http://mysvr; #请求转向mysvr 定义的服务器列表
  43. }
  44. }
  45. }