自动索引在 Nginx 中列出 UTF-8 字符集

Dar*_*lan 7 nginx charset utf-8

我的 nginx 自动索引页面没有正确显示 UTF-8 字符, utf-8 问题

我已经charset utf-8;nginx.conf文件的服务器块配置部分设置了,但这似乎并没有解决问题。

seb*_*ian 7

添加charset UTF-8;到 http、服务器或位置。

这是 my 的相关部分/etc/nginx/conf.d/default.conf,现在 autoindex 显示 UTF 字符。

server {
  listen 80;
  charset UTF-8;
  location / {
    root /usr/share/nginx/html;
    location /some/path {
      autoindex on;
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

我在https://www.cyberciti.biz/faq/nginx-set-http-content-type-response-header-to-charset-utf8/找到了这个。