You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using nginx with X-Accel-Redirect as documented within lib/rack/sendfile.rb does not seem to work for files which contain a % or ? character in their name.
How to reproduce:
Setup nginx with a location and X-Accel-Mapping as documented to allow sending files from /data/
Create a file /data/sample/Report90%.pdf
Trigger sendfile with the proper headers and file location pointing to /data/sample/Report90%.pdf
Nginx will accept the internal X-Accel-Redirect request but fail to read the file /data/sample/Report90%.pdf and return a 404 error to the client. This does not happen when the % is removed from the file name.
We tried to replace the % character with %25 (and therefore triggering X-Accel-Mapping with a path of /data/sample/Report90%25.pdf) which seems to work.
According to the changelog of nginx as of 2014 for version 1.5.9: now nginx expects escaped URIs in "X-Accel-Redirect" headers.