1. user www-data;
    2. worker_processes auto;
    3. pid /run/nginx.pid;
    4. events {
    5. worker_connections 768;
    6. # multi_accept on;
    7. }
    8. http {
    9. ##
    10. # Basic Settings
    11. ##
    12. sendfile on;
    13. #tcp_nopush on;
    14. #tcp_nodelay on;
    15. keepalive_timeout 120s;
    16. types_hash_max_size 2048;
    17. # server_tokens off;
    18. # server_names_hash_bucket_size 64;
    19. # server_name_in_redirect off;
    20. proxy_read_timeout 1000;
    21. # 附件上传大小
    22. client_max_body_size 100m;
    23. include /etc/nginx/mime.types;
    24. default_type application/octet-stream;
    25. ##
    26. # SSL Settings
    27. ##
    28. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    29. #配置共享会话缓存大小
    30. ssl_session_cache shared:SSL:10m;
    31. #配置会话超时时间
    32. ssl_session_timeout 10m;
    33. ##
    34. # Logging Settings
    35. ##
    36. access_log /var/log/nginx/access.log;
    37. error_log /var/log/nginx/error.log;
    38. ##
    39. # Gzip Settings
    40. ##
    41. gzip on;
    42. gzip_disable "msie6";
    43. gzip_vary on;
    44. # gzip_proxied any;
    45. gzip_comp_level 6;
    46. gzip_buffers 16 8k;
    47. gzip_http_version 1.1;
    48. gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    49. gzip_min_length 1k;
    50. ##
    51. # Virtual Host Configs
    52. ##
    53. include /etc/nginx/conf.d/*.conf;
    54. include /etc/nginx/sites-enabled/*;
    55. }