pay_vue_admin.conf 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. server {
  2. listen 80;
  3. client_max_body_size 20M;
  4. # listen 443 ssl;
  5. # ssl_certificate /opt/secure/https_ssl/py163.xyz/py163.xyz.cer;
  6. # ssl_certificate_key /opt/secure/https_ssl/py163.xyz/py163.xyz.key;
  7. # ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  8. # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  9. #多个域名用空格分割,第一个为默认
  10. server_name payadmin.test www.payadmin.test;
  11. charset UTF-8;
  12. index default.html default.htm index.html index.htm;
  13. # 定义根目录
  14. set $root /var/www/pay-vue-admin/dist;
  15. # 设置站点路径
  16. root $root;
  17. # 限制IP
  18. # include ca/ip_limit.conf;
  19. location / {
  20. try_files $uri $uri/ /index.html;
  21. }
  22. # 防止目录浏览
  23. autoindex off;
  24. #sendfile off;
  25. #error_page 404 /err/404.htm;
  26. # 将php类型的请求转交给fastcgi
  27. #缓存图片周期30天
  28. location ~* \.(jpg|jpeg|gif|png|webp)$ {
  29. access_log off;
  30. expires 30d;
  31. }
  32. #缓存js和css7天
  33. location ~* \.(js|css)$ {
  34. access_log off;
  35. expires 7d;
  36. }
  37. # 访问日志:
  38. access_log /var/log/nginx/pay_vue_admin.access.log;
  39. error_log /var/log/nginx/pay_vue_admin.error.log;
  40. }