需要修改nginx的server的配置内容,增加一行:charset utf-8;

比方说:

server {
    listen       80;
    listen  [::]:80;
    server_name  localhost;
    # 这里
    charset utf-8;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
    }
}

再重启nginx。