gpt4 book ai didi

NGINX 将 SVG 视为纯文本

转载 作者:行者123 更新时间:2023-12-04 14:55:00 26 4
gpt4 key购买 nike

我正在尝试从 SVG 文件加载图像。但是,我的 nginx 服务器上的 mime.types 文件存在正确的行:

...
image/svg+xml svg svgz;
...

当我尝试下载文件时,服务器说它是纯文本:

$ wget -O - -S http://172.22.253.119:2998/tw-logo-on-dark-2.svg > /dev/null
--2018-06-26 09:05:06-- http://172.22.253.119:2998/tw-logo-on-dark-2.svg
Connecting to 172.22.253.119:2998... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: nginx/1.13.12
Date: Tue, 26 Jun 2018 14:05:06 GMT
Content-Type: text/plain
Content-Length: 26706
Last-Modified: Mon, 25 Jun 2018 16:05:40 GMT
Connection: keep-alive
ETag: "5b3112d4-6852"
Accept-Ranges: bytes
Length: 26706 (26K) [text/plain]
Saving to: ‘STDOUT’

谁能告诉我我做错了什么?

最佳答案

解决方案是将其包含在我的 nginx.conf 中:

http {
include /etc/nginx/mime.types; # This includes the built in mime types
}

关于NGINX 将 SVG 视为纯文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51045084/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com