nginx 中文乱码(nginx常见错误代码)

在/usr/local/nginx/conf/nginx.conf 配置文件中插入charset utf-8;或者charset 'utf-8';
server {
 listen 80;
 server_name localhost;
 charset utf-8; 
 #access_log logs/host.access.log main;
 location / {
 root html;
 index index.html index.htm;
 }
或者
server {
 listen 80;
 server_name localhost;
 charset 'utf-8'; 
 #access_log logs/host.access.log main;
 location / {
 root html;
 index index.html index.htm;
 }

重新加载配置文件

/usr/local/nginx/sbin/nginx -s reload

nginx 中文乱码(nginx常见错误代码)

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发表评论

登录后才能评论