iwyg / jitimage

Just In Time image manipulation (GD, Imagick, imagemagick) with integration for laravel 4
MIT License
95 stars 8 forks source link

image is existed in response but there is 404 Not Found in HTTP header #43

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hi, I like Jit. and I want to use it in my project. Jit works fine on the local host(nginx on linux) but My project have been published remote web server and than Jit doesnt work correctly on remote server.

My Project is in my VPS. My local and VPS are same that Nginx on ubuntu 14.04.

I want to notice again, Jit perfectly works on my local, but it doesn't on remote server. The issue is existed and cached image gettting by 404 header error, but it can viewed on browser.

I checked this issue again and again.

For examle nginx error log

2014/09/20 13:00:06 [error] 2534#0: *35 open() "/home/plastport/www/plastport/public/jit/storage/53c5ea0f/jit5739d988593c9b91b79.jpg" failed (2: No such file or directory), client: 185.26.182.27, server: www.sarentasarim.com, request: "GET /jit/storage/53c5ea0f/jit5739d988593c9b91b79.jpg HTTP/1.1", host: "www.sarentasarim.com"

in my terminal

muratsplat@ThinkPad:~/web_root/laravelplastport$ curl  -I http://www.sarentasarim.com/jit/storage/53c5ea0f/jit5739d988593c9b91b79.jpg
HTTP/1.1 404 Not Found
Server: nginx/1.4.6 (Ubuntu)
Content-Type: image/jpeg
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.4
Cache-Control: public
Date: Sat, 20 Sep 2014 10:25:49 GMT
Last-Modified: Fri, 19 Sep 2014 18:32:21 GMT
ETag: "043b7bd540ed7e809d02e9bb6c29a106"
Accept-ranges: bytes
Set-Cookie: s-panel=eyJpdiI6IjJMeTk0V2huaTV3Znk3TWN3OFdJS2Vmb3N4dlFpMEtGdHFKbUJ6U29zdHM9IiwidmFsdWUiOiJ5dTltOVJNUmxhMjlKZmtHd2lod29MekdcL3NoVitwSGhDcDgrczdSMHlzQmY4bU4yVUpUenp6Ulo0cm9oN0sxc0VNelVEU0pISlBFd1lqNEk2QUp4Y2c9PSIsIm1hYyI6IjUwZTgwYWYzN2MwNmJmNDgwNzQxNTllZTViYWM2NmI4OTk1MDdlMGE3ODQyZWFmYmE5YjNlOWFhYTE4OTY2NDkifQ%3D%3D; expires=Sat, 20-Sep-2014 12:25:49 GMT; Max-Age=7200; path=/; httponly

But the image was existed in response, I want show that by using curl on my terminal

muratsplat@ThinkPad:~/web_root/laravelplastport$ curl   http://www.sarentasarim.com/jit/storage/53c5ea0f/jit5739d988593c9b91b79.jpg
����JFIF``��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 80
��C



 %# , #&')*)-0-(0%()(��C



(((((((((((((((((((((((((((((((((((((((((((((((((((����"��

���}!1AQa"q2��#B��R��$3br� 
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������

���w!1AQaq"2B����    #3R�br
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������
                                               ?���fh�>�fh�>�fh�>�fh�>��3Fh��4�њ~h�34f��3L�����3Fh��4�њ~h�34f��3L�����3Fh��4�њ~h�34f��3Q�ތ���5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5}��I�3Q���y�5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5h�I�3Q�����5h�E����7P���Qn�uK����7P���Qn�uK����7P���Qn�uK����7P���Qn�uK����7P���Qn�uK����7P���Qn�uK����7P���Qn�uK����7PY�uE���.�3Qn�uK����7P���Qn�uK����7P���P��uM��՟�jV�t--��PFIv�p:��}5,��Ծ�LǨ�O�zv�7W��?��SE���򃄑aR���*9�u:��k�
                                       �{O'�����;{�{��y�������]�f��F��4f��F��u�wQ��&���Q��%��wQ��&��wR�wQ���F�M���7Pۨ�P��uM���7Pۨ�P��+�ח]\ى��-�)��F@��A�i��o�>+�t�H�n�70X�B
                        �ּ��?��ݭ�M<    :;/��k��2����Q�{�s�gT9�ܩ�Ҫk���m-ŌZT�.K�u��O��    a�~��fl�>)���u������E��W�CE�;�uyz��:|�.�6�v[}��8+�S�T���e��R�6��a��{���~�j�����img�D�4�� �ꧭ1    0����$�˛S�ɑy�
w9\1?��T���o���[[����b;���c�8���V6��    ������_١�TL�����Tھ����ws�VzM�_m�����N��G>�۵!�-m��+���CI|n{��>�F   L�Mo�mD����
                                             �F���mm�B~�����f�g�����U������W�'ׁYskF�I�H�t�u��;3J�7���#�Jb=A~%�vvw7���\�:4r�ࡇ���[�w��.��{���?w�?=���ö�i��1�|��R��@�븒F~��
��Bm�+IC7�p��o��=?AJ�=�M�mu0Zɹ���#s�?������4[“x���IT9ی�>��U��Dۨ�P��uM���7Pۨ�P��uM���7P;��Qn�u0%�F��u�]�n��Q��%�F��u�]�Z������v�7�Z�u���Vrd��D}n�?�b�~���[��%HԱ*��k��U5o�L�_X��SL3MJvx�p���*��^�}����_��'�\U���A\��i����oU85�a<Wr��W6��e+�j�_Ӛ,3I!��������vPf��5��븎����S����Y"Y|O��s�s$���b�ۭihp��Zdd����,����ɪHnd�i��������maX��H�^��n�uM����Qn�u %�F��u.��u�-�n�  wQ���F��u�-�nwQ���F�z�u��n�    �Q���F��u��n�   �Q���F��uV�Nl.?�?ʟ���9�������8���s��j�.x�`j}��rw�
  ��|էz>cT�0&�LV߇�u�!�M��B�m�hg[������
C=�u��n���u��n�   �Q���F��u��n�   �Q���F��u��nwRn��Q��%�K���F��u�-�n�    �Q���F��u�-�n�   wT7���7���uEtٷ���@��CX�z�.�W=���sw��T1�^��j�y��Vu���ΰ���    �X��@i1�ź�uC��՘n�uC���6�7T;��@n��Qn�uM���7Pۨ��C����7T;��uM���7Pۨ�P��uM���7Pۨ�P��uM���o�I������}F(���k����;����͏�ֹ�D`��sW�x�~���z��u��u�?����z3]���忎����Y��8�'�����7Vc&�F��u�m�n�wQ��&�F��u�m�n�wQ��&�F��u�-�n��Rn�    �Q���F��u��n�   �Q���F��u��n�   �Q���F���#YJ���+��x�yR�=f�=P�J��?�jЎ���X�����ת�5���
׽_��D�����2���q^��#�횎�oז�^�ῗC���SJ@ln�uC���&�F��u�m�n�wQ��&�F��u�m�n�wQ��&�F��u.����=ԛ�]�n��Q��%�F��u�]�n��Q��%�F��u�]�n��Q��!�
Z�������|ƨ���r��ۣ�f+���N�N4�A�L��THf��7T[��R���Qn�uK����7P���Qn�uK����7P�E��uDZ��Y�4.�7TY�4.�7TY�4.�7TY��4.�7TY�4.�7TY�4�')ɮ{U)�}AZE��ym;Fǚ��s��UFX�;צ�!��۪ S��C�ϟ�M��)i�
�l4�    �����>Rg�j[���Qf��]�n��Fh]�n��h�K���h�K�7TY�4.�TY�44f��3L�����Lh�I�3L�&hLњf�$��f�4&h�G�3@f��y�4&iA��K�fi3M����4��@�&i��4�њfh����3Fh��4�(��4�њ~h�2�~i3M�����3Fh٥�34f��L�sFh٥�34f��3L�����3Fh�muratsplat@ThinkPad:~/web_root/laravelplastport$ 

Why Jit returns a response includes 404 header message for the image that existed and viewed?

Jit code on my view


JitImage::source($v->getFirstImage())->resize(240, 0); // $v->getFirstImage() return like '/foo/bar.jpg'

Thank you for your effort. Even so I think to Jit is usefull extension for laravel

ghost commented 10 years ago

while I'was lookig for a solution, I have been compared the remote server and my local server. And I have found one different point that caching is enabled in nginx configuration on remote server.

Caching which is Nginx has causes this issue,

I have been trying to use xsend with Nginx X-accel but it is not working.. Maybe when it can use xsend with Nginx X-accel feature, Nginx's caching feature works fine both xsend ...

iwyg commented 10 years ago

x-send isn't actually useful at all (since jitimage response uses http caching), and will be removed in the next version (you still can use it of course). Thanks for letting me know that nginx caching causes problems. Will look into that shortly.

ghost commented 10 years ago

Thank you for that you have been inform me ..

I want to say again, your extention is great :)

iwyg commented 10 years ago

thanks :)

dannymichel commented 8 years ago

I have the same issue, and I don't think this has been answered. Am I missing something?