I have developed rest api using laravel and calling them from Angular 4. Its all working fine on local system as I'm running laravel using "php artisan serve". But when i host it on AWS EC2 Instance as by the same way and when I call api then it gives me 404 error.
You need to point the web root to the public directory. RIght now you have to prefix everything with the public directory which is also exposing your .env file to the world.