#Requested URL not found

5 messages · Page 1 of 1 (latest)

plucky tendon
#

Hi,
I have a route to serve files from the private storage. See attached image.
I use this root inside the bootstrap fileinput in the frontend. See attached image.

It works on my machine 😎 .
If I deploy the app to the webserver, everything is still working, except the preview and I get the errormessage in the console and fileinputpreview:
The requested URL /serveFile/claim_74_669645b2ea1c3.pdf was not found on this server.

The file is existing in the private storage, but the code doesn't reach this point.
I activated the debugbar and tried to get some debugmessages or even throw an exception at the entrypoint of this route.
Again, it works on my machine, but on the webserver it seems like the call doesn't reach the method from the controller.

I checked the routes, but it is registered. See image.

At this point I don't know enough about laravel and at which point the webserver, some middleware or something else is intercepting this call.
Can someone give me some advice for debugging this problem?

grave burrow
#

Did you try changing the 404 in serveFile() and loading the path? That tells you whether the request gets there or not. That would be an easy first step.

plucky tendon
#

It is an problem with the htaccess file. Looks like my local webserver from Herd doesn't use it. There is a rewrite rule for all kind of files.
Found this SO post
https://stackoverflow.com/questions/74129722/nginx-throws-404-error-for-a-file-route-in-laravel

somber mantle
#

wait, nginx or apacha?

#

Anyway, you can double check your network request and do as kefren suggested to check if the request gets there or not. I suspect it is aborting in your abort(404