Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Why can't I show CJK characters normally in nginx?

Environment: Windows 10 + nginx/1.8.0. The files in the mysql directory are all in UTF-8 encoding, and all HTML files in mysql contain <meta charset="utf-8" />.

My configuration file for file nginx.conf:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  localhost;
        charset gbk,utf-8;
        source_charset gbk,utf-8;
        autoindex on;
        location / {
            root   d:/mydoc/build/html;
            index  index.html index.htm;
            charset gbk,utf-8;
            source_charset gbk,utf-8;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

I start my nginx server and open the mysql directory in Firefox:

Enter image description here

All CJK characters are shown correctly. Now to click the third third title----mysql日志.html:

Enter image description here

Display file error.log to check what happened:

2020/12/05 22:41:19 [error] 11252#11076: *8 CreateFile() "d:/mydoc/build/html/mysql/mysql日志.html" failed
(2: The system cannot find the file specified),
client: 127.0.0.1, server: localhost, request:
"GET /mysql/mysql%C8%D5%D6%BE.html HTTP/1.1", host: "127.0.0.1", referrer: "http://127.0.0.1/mysql/"

Input http://127.0.0.1/mysql/mysql日志.html in my Firefox and click. All CJK characters are shown correctly.

Enter image description here

How do I solve the issue that it jump into a webpage containing garbled CJK characters when to click title in 127.0.0.1/mysql?

It is verified that for same directory and files CJK character can shown correctly in nginx + Linux instead of nginx + Windows.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Following the alibabacloud guide, my best guess is that you should use only charset utf-8 and you should also check that all filenames are in UTF-8 format or convert to UTF-8 otherwise (only filenames, not the content).

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!