Friday, January 29, 2016

nginx - 404 on images (only some images)

By default, nginx automatically decodes the url you send to it.

So , if you are looking for an image which has it's real name as the url encoded version of it, you will get error 404 - because nginx will try to grab the decoded version of the filename!

I haven't found a good workaround for this ATM. Checking.

UPDATE:

On my local server, every image is getting loaded properly.

On my remote server, only some of the images are getting loaded properly (others are 404).

Here's the final cause:


The images which returning error 404 where those for which urlencode(name)!=name!
During the transfer to my remote server, my picture names got url encoded somehow and that caused all the trouble!

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...