在/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首頁中文亂碼怎麼解決的詳細內容。更多資訊請關注PHP中文網其他相關文章!