nginx.conf 943 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. server {
  2. listen 80;
  3. server_name localhost;
  4. root /usr/share/nginx/html;
  5. gzip on;
  6. gzip_disable "msie6";
  7. gzip_vary on;
  8. gzip_proxied any;
  9. gzip_comp_level 6;
  10. gzip_buffers 16 8k;
  11. gzip_http_version 1.1;
  12. gzip_min_length 256;
  13. gzip_types
  14. application/javascript
  15. application/json
  16. application/manifest+json
  17. application/xml
  18. font/eot
  19. font/otf
  20. font/ttf
  21. image/svg+xml
  22. text/css
  23. text/javascript
  24. text/plain
  25. text/xml;
  26. location / {
  27. index index.html index.htm;
  28. try_files $uri $uri/ /index.html;
  29. add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
  30. }
  31. location ~* \.(?:css|js|woff2?|eot|ttf|otf|svg|png|jpe?g|gif|ico)$ {
  32. expires 1y;
  33. access_log off;
  34. add_header Cache-Control "public, max-age=31536000, immutable";
  35. }
  36. }