在server模块中添加两个代码 注意位置不要写错,写在server模块里,location模块外面 default_type 'text/html'; charset utf-8; 然后重启nginx生效 nginx -t nginx -s reload