nginx.conf 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. user nginx;
  2. worker_processes auto;
  3. error_log /var/log/nginx/error.log notice;
  4. pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 65535;
  7. }
  8. http {
  9. include /etc/nginx/mime.types;
  10. default_type application/octet-stream;
  11. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  12. '$status $body_bytes_sent "$http_referer" '
  13. '"$http_user_agent" "$http_x_forwarded_for"';
  14. access_log /var/log/nginx/access.log main;
  15. sendfile on;
  16. #tcp_nopush on;
  17. keepalive_timeout 65;
  18. #gzip on;
  19. gzip on;
  20. gzip_http_version 1.0;
  21. gzip_static on;
  22. gzip_min_length 1k;
  23. gzip_buffers 4 16k;
  24. #gzip_http_version 1.1;
  25. gzip_comp_level 5; # 压缩级别
  26. # 要压缩的mine类型
  27. gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss image/jpeg image/gif image/png image/svg+xml;
  28. gzip_vary off;
  29. gzip_proxied expired no-cache no-store private auth;
  30. gzip_disable "MSIE [1-6]\."; # IE6不支持gzip
  31. include /etc/nginx/conf.d/*.conf;
  32. }