NGINX + VUE 无法展示图标 问题解决

shell 复制代码
server {
    listen 80;
    server_name your-domain.com;

    root /path/to/your/build/directory;

    location / {
        try_files $uri $uri/ /index.html;
    }

    location = /favicon.ico {
        access_log off;
        log_not_found off;
        expires max;
    }
}

像上面的nginx 的conf一样

在配置中为你的服务添加一个代理规则: 不要将资源文件图标进行代理

shell 复制代码
    location = /favicon.ico {
        access_log off;
        log_not_found off;
        expires max;
    }

favicon.ico是图标名称,改成你的那个名就行

相关推荐
Rsun045515 小时前
React相关面试题
前端·react.js·前端框架
鹏多多.5 小时前
Flutter使用screenshot进行截屏和截长图以及分享保存的全流程指南
android·前端·flutter·ios·前端框架
LawrenceLan5 小时前
37.Flutter 零基础入门(三十七):SnackBar 与提示信息 —— 页面反馈与用户交互必学
开发语言·前端·flutter·dart
迪巴拉15256 小时前
基于Vue与Spring Boot+Open Cv的智慧校园考勤系统
前端·vue.js·spring boot
swipe6 小时前
JavaScript 对象与属性描述符:从原理到实战
前端·javascript·面试
&活在当下&6 小时前
Vue3 h函数用法详解
前端·javascript·vue.js
小贵子的博客6 小时前
(vue3错误处理)has naming conflicts with other components, ignored.
前端·javascript·vue.js
me8326 小时前
【Java】踩坑实录:Spring Boot + Nginx 本地部署404终极排查:从80端口被占用到配置生效全流程
java·spring boot·nginx