Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

257
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda