nginxurlencodecjk

Nginx mapping Japanese URL to encoded file/folder names


I have file names written in encoded format. For example, this URL /2012年日本の旅/ is saved as: /2012%e5%b9%b4%e6%97%a5%e6%9c%ac%e3%81%ae%e6%97%85/index.html on Nginx server.

But Nginx does not serve the URL.

If I change the folder name in the Japanese language, it works. I mean /2012年日本の旅/index.html


Solution

  • According to this SO question and this one and assuming you are using e.g. try_files to serve files, simply use $request_uri instead of $uri. Without your nginx.conf that's about all one can say.