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

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

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    搭建的网站不显示favicon.ico
    48
    0
    新项目,在本地调试可以正常显示favicon.ico然后部署到服务器上时不显示下面是目录结构index.html中引用了favicon.ico<link rel="icon" href="./favicon.ico" type="image/x-icon"/>下面是打包结构下面是nginx配置user nginx;worker_processes auto;error_log /var/log/nginx/error.log;pid /run/nginx.pid;# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.include /usr/share/nginx/modules/*.conf;events { worker_connections 1024;}http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/conf.d/*.conf; server { listen 80 default; listen 443 ssl http2; gzip on; gzip_buffers 32 4k; gzip_comp_level 6; gzip_min_length 200; gzip_types text/css text/xml application/javascript application/json; location / { root /usr/local/blog/front; index index.html index.htm; try_files $uri $uri/ /index.html; } # 配置前端访问地址 location /admin { root /usr/local/blog; index index.html index.htm; try_files $uri $uri/ /admin/index.html; } location ^~ /api/blog { index index.html index.htm index.php; index proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; index proxy_set_header Host $host; index proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:8086/api/plumemo-service; } # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } }}本地可以显示,到服务器就不行了。。调试发现,服务器上没有请求favicon.ico而本地调试有请求favicon.ico大佬救救孩子
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • ザ@忘卜了ㄊ伱﹄ 普通会员 1楼

      favicon.ico是网页的图标,通常是蓝色的,圆形的,类似于一个二进制的跳跃的小人。如果你的网站没有显示favicon.ico,那么可能的原因有以下几点:

      1. 网站的主题不支持ico图标:一些网站为了使内容更加清晰,可能会使用非标准的HTML图像格式,比如SVG或JPEG,这些格式可能不被某些浏览器支持。

      2. ico文件在服务器上不存在:如果网站的服务器上没有保存favicon.ico文件,那么你的浏览器可能无法找到这个图标。

      3. 网站的URL路径错误:如果你的favicon.ico文件放在了错误的URL路径中,那么你的浏览器可能无法找到这个文件。

      解决这个问题的方法有很多,具体取决于你网站的具体情况。以下是一些可能的解决方案:

      1. 检查网站的主题:你可以尝试更换网站的主题,看看是否可以解决问题。

      2. 检查ico文件:你可以尝试检查网站的ico文件,看是否在服务器上存在,以及文件的URL是否正确。

      3. 检查URL路径:你可以检查网站的URL路径,看是否正确,以及文件是否放在了正确的路径中。

      4. 更新浏览器:如果你的网站使用了旧版本的浏览器,可能需要更新浏览器。

      5. 使用Web Hosting:如果你的网站使用了Web Hosting服务,那么可能是Web Hosting提供商的问题,你可以尝试联系他们解决问题。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部