账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    vue spa nginx 如何配置,能够让index.html不缓存呢(微信公众号),求解答。。真心感谢
    36
    0

    spa是vue脚手架npm run build 出来的一套静态资源
    /home/nodeuser/apps/hcz-weichat/source/dist这个目录存放着静态资源

    nginx配置文件如下

    /etc/nginx/conf.d/hcz_weichat.conf
    
    server {
        listen 80;
        server_name domain;
        
        location /favicon.ico {
            root /home/nodeuser/apps/hcz-weichat/source/dist;
        }
    
        location / {
            root /home/nodeuser/apps/hcz-weichat/source/dist;
            index index.html;
            try_files $uri /index.html;
        }
    }
    0
    打赏
    收藏
    点击回答
        全部回答
    • 共 0 条
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部