Skip to content

静态站点模板

适合普通 HTML、文档站、没有前端路由的静态站点。

替换:

  • example.com
  • /var/www/app/dist
nginx
server {
    listen 80;
    listen [::]:80;
    server_name example.com;

    root /var/www/app/dist;
    index index.html;

    access_log /var/log/nginx/example.com.access.log;
    error_log /var/log/nginx/example.com.error.log;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~* \.(?:css|js|mjs|png|jpg|jpeg|gif|svg|webp|ico|woff2?)$ {
        try_files $uri =404;
        access_log off;
        add_header Cache-Control "public, max-age=604800";
    }
}

基于 MIT 许可发布