Unable to access Chinese filename under Nginx

Source: Internet
Author: User

Method One:

Have done most of the day Nginx can not access the Chinese file name problem, now seems to be the problem of SECURECRT?

It seems to be a problem with character sets.

It seems that Nginx does not need to be loaded separately to support Chinese modules like Apache.

The server-side character set is as follows

[root@test]# Locale

Lang=en_us. UTF-8

Lc_ctype= "en_US. Utf-8″

Lc_numeric= "en_US. Utf-8″

Lc_time= "en_US. Utf-8″

Lc_collate= "en_US. Utf-8″

Lc_monetary= "en_US. Utf-8″

Lc_messages= "en_US. Utf-8″

Lc_paper= "en_US. Utf-8″

Lc_name= "en_US. Utf-8″

Lc_address= "en_US. Utf-8″

Lc_telephone= "en_US. Utf-8″

Lc_measurement= "en_US. Utf-8″

Lc_identification= "en_US. Utf-8″

Lc_all=

The character set configured in the Nginx.conf file is also utf-8

server {

Listen 80;

server_name test.cn;

Root/data;

Index index.html index.jsp;

CharSet Utf-8;

The client uses is SECURECRT, the character set uses is Defalut, uses the RZ to upload on the server with the LS to display garbled, uses IE how to browse all can not see normally.

To find a friend to test his side of the Nginx, Chinese display incredibly all normal, and then he told me his secruecrt use of the character set is Utf-8, I use the uft-8 after using RZ upload files, in IE Chinese can be normal display.

Method Two:

One: Make sure your system is UTF coded

[Root@tserver ~]# Env|grep LANG

Lang=en_us. UTF-8

Two: The Nginx configuration file is set to

Server

{

Listen 80;

server_name. inginx.com;

Index index.html index.htm index.php;

root/usr/local/nginx/html/inginx.com;

CharSet Utf-8;

}

Three: If you use putty

Windows--> translation-->utf-8

mkdir nginx Chinese Technology Station

Echo nginx Chinese technology station > China. html

Four, if it is to upload files with SECURECRT, please select the--> appearance--utf-8

Five, if the filename appears garbled display

Perform

For f in ' LS *.html '; Do mv $f ' ls $f |iconv-f gbk-t UTF-8 '; Done

Another friend's solution is:

The way I'm using it is

In the back-end of the individual directory with the Apache proxy.

Apache supports Chinese code.

Location/~doc/{

Proxy_pass http://127.0.0.1:81/#apache Server

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.