mercredi 27 avril 2022

laravel 5.8.38 weird route issue with wildcard

I'm running a laravel 5.8.38 on nginx and have this weird route issue

the route is very simple

Route::get('/{appKey?}', 'AppSetupController@index');

that's it nothing more

the {appKey} is something created from time to time by our users with this php function

uniqid("fsapp");

so the appkey will be 18 digits characters like this, and the full url is something like this

mydomain.com/fsapp6268ad9d42fc3

we have thousands of this and everything work well except this one, this one just go straight to 404 i tried to trace the issue on the file AppSetupController on function index, but this exact appKey doesn't even land on this function, it goes straight to 404 and i don't even know how to trace this issue

if i just change even 1 character from this fsapp6268ad9d42fc3 it will go to the correct route and it just work as intended only this one i don't know why always go to 404

============SOLVED================

turns out it was 403 instead of 404, check on chrome's console the real error code was 403, not 404. but on nginx this domain was set showing 404.html on all error code

after further check, turns out there was a folder on public_html/public with that same name as the appkey



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire