Home >Operation and Maintenance >Nginx >How to solve Chinese garbled characters on nginx home page

How to solve Chinese garbled characters on nginx home page

PHPz
PHPzforward
2023-05-23 19:10:042544browse

How to solve Chinese garbled characters on nginx home page

Solution

在/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;
       }

Reload the configuration file

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

The above is the detailed content of How to solve Chinese garbled characters on nginx home page. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete