I am loosing my mind on this and maybe someone had this issue before. Here is my setup.
- I am running a laravel app on a aaPanel setup.
- Laravel has an application running no issues.
- I have a symlink created that goes to /storage/app/public
When i save an image using laravel i can see the file in the folder now /public/storage/attachments/images.jpg.
I can preview the file no issues there. When i try to open it in the website i will get 404, when i try using direct link like domain.com/storage/attachments/images.jpg. it will not open and will get 404 for about 3-10 minutes. at some point after a few refreshes the image will now work. No only that but any image loaded there previously will work with no issues.
The big issue is that it will work after some time and this is what i dont understand.
Things I tired:
1.I check the Nginx config and found some changes but no luck.
2.Rebooted the server
3.remove and recreated the symlink using artisan and also just suing linux command same issue.
4.Change permission/ even if you give it the max it will not work.
5.Loaded an image directly in the server – works
i actually loaded the same file and i can see both in the server but i can only load the one that that i uploaded directly. the one uploaded by laravel will say 404. And yes i can see the size is the same, i can preview it just fine.
What would cause laravel uploaded file not to load.