nginx.conf 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 1024;
  7. use epoll;
  8. multi_accept on;
  9. }
  10. http {
  11. include /etc/nginx/mime.types;
  12. # 加载外部配置
  13. include /etc/nginx/app_conf/lq_admin_server.conf;
  14. include /etc/nginx/app_conf/sub_system_server.conf;
  15. include /etc/nginx/app_conf/lq_ai_middle_platform_front_server.conf;
  16. default_type application/octet-stream;
  17. # 日志格式
  18. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  19. '$status $body_bytes_sent "$http_referer" '
  20. '"$http_user_agent" "$http_x_forwarded_for"';
  21. access_log /var/log/nginx/access.log main;
  22. # 基本配置
  23. sendfile on;
  24. tcp_nopush on;
  25. tcp_nodelay on;
  26. keepalive_timeout 65;
  27. types_hash_max_size 2048;
  28. client_max_body_size 10M;
  29. # Gzip 压缩
  30. gzip on;
  31. gzip_vary on;
  32. gzip_min_length 1024;
  33. gzip_proxied any;
  34. gzip_comp_level 6;
  35. gzip_types
  36. text/plain
  37. text/css
  38. text/xml
  39. text/javascript
  40. application/json
  41. application/javascript
  42. application/xml+rss
  43. application/atom+xml
  44. image/svg+xml;
  45. # 安全头
  46. add_header X-Frame-Options "SAMEORIGIN" always;
  47. add_header X-Content-Type-Options "nosniff" always;
  48. add_header X-XSS-Protection "1; mode=block" always;
  49. add_header Referrer-Policy "no-referrer-when-downgrade" always;
  50. }