nginx 配置 单页面应用的解决方案

时间:2023-12-13 21:59:20
server {
listen 80;
server_name example.com;
root /var/www/example.com; gzip_static on;

    location / {

index index.html;

rewrite ^/.*/$ / last; # Redirect everything to / (ex index.html) and let the JS router take care of the rest

rewrite ^([^.]*[^/])$ $1/ permanent; # Force trailing slash

}

}

多么滴easy 啊

相关文章