In Apache, to implement Chinese support requires a separate Chinese module, while Nginx supports multiple encodings and does not need to install other components, but defaults to utF-8 support route. There are two ways to implement Nginx support for Chinese urls.
Methods a
Transcoding the file name with convMV
This method can be used only in emergencies (when the server cannot be restarted during periods of heavy traffic).
CentOS is used as an example. The same applies to other systems.
Install the convmv
yum -y install convmv
transcoding
Convmv-fgbk-tutf8-r — notest target
-f is the source code, -t is the target code, -r is the recursive processing directory, -notest is not moved, actually rename the file, target is the target directory.
Method 2
Change the Nginx site configuration file to UTF-8.
System regional language Settings
vi /etc/sysconfig/i18n
join
LANG=”en_US.UTF-8″
SYSFONT=”latarcyrheb-sun16″
And restart the system (created if this file is not available)
Change Nginx Settings
Edit the Nginx configuration file for your site and add it to sever
charset utf-8;
Such as:
server{
listen 80;
servername www.fuwuqijia.com;
root /www;
index index.html index.jsp;
charset utf-8;
…
Set the CHARACTER set of FTP and shell tools to UTF-8.