default.conf.template 792 B

12345678910111213141516171819202122232425262728
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. server_name localhost;
  5. access_log /var/log/nginx/host.access.log main;
  6. location / {
  7. gzip on;
  8. gzip_min_length 5;
  9. gzip_comp_level 3;
  10. #定义压缩文件的类型
  11. 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 application/json;
  12. root /usr/share/nginx/html;
  13. #index index.html;
  14. try_files $uri $uri/ /index.html;
  15. }
  16. #error_page 404 /404.html;
  17. # redirect server error pages to the static page /50x.html
  18. #
  19. error_page 500 502 503 504 /50x.html;
  20. location = /50x.html {
  21. root /usr/share/nginx/html;
  22. }
  23. }