nginx.conf 900 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. worker_processes auto;
  2. events {
  3. worker_connections 1024;
  4. }
  5. http {
  6. include mime.types;
  7. default_type application/octet-stream;
  8. sendfile on;
  9. keepalive_timeout 65;
  10. client_max_body_size 20m;
  11. server {
  12. listen 80;
  13. server_name localhost;
  14. gzip on;
  15. gzip_min_length 1k;
  16. gzip_comp_level 9;
  17. gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
  18. gzip_vary on;
  19. location / {
  20. root /usr/share/nginx/html;
  21. index index.html index.html; #配置首页
  22. try_files $uri $uri/ /index.html; #防止刷新报404
  23. }
  24. error_page 500 502 503 504 /50x.html;
  25. location = /50x.html {
  26. root html;
  27. }
  28. }
  29. }