Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

253
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda