nginx首页中文乱码问题解决方法

树叶云

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

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/220917.html<

(0)
运维的头像运维
上一篇2025-04-14 19:15
下一篇 2025-04-14 19:17

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注