# 404 error when %20 is in file name

**URL:** <https://www.ruby-forum.com/t/404-error-when-20-is-in-file-name/214295>\
**Category:** NGINX\
**Created:** [November 27, 2011, 5:20pm UTC](https://www.ruby-forum.com/t/404-error-when-20-is-in-file-name/214295 "2011-11-27T17:20:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [November 27, 2011, 5:20pm UTC](https://www.ruby-forum.com/t/404-error-when-20-is-in-file-name/214295/1 "2011-11-27T17:20:44Z")

</div>

I’m running the latest version of nginx. When I try to serve a file with  
a “%20” in the name (example funny%20picture.jpg) I get a 404 error. The  
filename itself has the “%20” in it, not a space. But nginx refuses to  
serve the file. Any ideas on a configuration change I can make so that  
this works?

Posted at Nginx Forum:

> **[404 error when %20 is in file name](https://forum.nginx.org/read.php?2,219147,219147#msg-219147)**
>
> I'm running the latest version of nginx. When I try to serve a file with a "%20" in the name (example funny%20picture.jpg) I get a 404 error. The filename itself has the "%20" in it, not a space. But nginx refuses to serve the...

---

<div class="post-metadata">

**Author:** ![jstalin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@jstalin](https://www.ruby-forum.com/u/jstalin)\
**Post date:** [November 27, 2011, 6:22pm UTC](https://www.ruby-forum.com/t/404-error-when-20-is-in-file-name/214295/2 "2011-11-27T18:22:13Z")

</div>

On Sun, Nov 27, 2011 at 11:20:17AM -0500, jstalin wrote:

> I’m running the latest version of nginx. When I try to serve a file with  
> a “%20” in the name (example funny%20picture.jpg) I get a 404 error. The  
> filename itself has the “%20” in it, not a space. But nginx refuses to  
> serve the file. Any ideas on a configuration change I can make so that  
> this works?

If you want to get “funny%20picture.jpg”, you should encode “%” in  
request  
as “%25”: “funny%2520picture.jpg”.

–  
Igor S.
