standalone-8090.conf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # =============================================================================
  2. # vasen-website 独立 8090 端口配置(简化版,本地直连用)
  3. #
  4. # 不需要 HTTPS 证书,适合本地开发/快速预览。
  5. # 访问地址:http://localhost:8090/
  6. #
  7. # 注意:此配置不包含 water-cology SPA 的 CORS/mock 路由,
  8. # 完整功能请使用 vasen-website.conf(配合 HTTPS server)。
  9. # =============================================================================
  10. server {
  11. listen 8090;
  12. server_name _;
  13. root /lio/projects/vasen-website;
  14. index index.html;
  15. charset utf-8;
  16. location / {
  17. try_files $uri $uri.html $uri/ $uri/index.html =404;
  18. }
  19. # HTML 不缓存
  20. location ~* \.html?$ {
  21. add_header Cache-Control "no-cache, must-revalidate";
  22. expires off;
  23. }
  24. # 静态资源长缓存
  25. location ~* \.(js|css|svg|ico|png|jpg|jpeg|gif|woff2?|ttf|eot|pdf)$ {
  26. expires 30d;
  27. add_header Cache-Control "public";
  28. access_log off;
  29. }
  30. # 健康检查
  31. location = /healthz {
  32. add_header Content-Type text/plain;
  33. return 200 "ok\n";
  34. access_log off;
  35. }
  36. # 安全:禁止访问隐藏文件
  37. location ~ /\. {
  38. deny all;
  39. }
  40. }