DEV Community

loading...

Discussion on: Laravel Deployment on Elastic Beanstalk

Collapse
safventure profile image
Saf Venture • Edited

I was able to fix it. This is what I did.

cd /etc/nginx/conf.d/elasticbeanstalk - Navigate to the php.conf file
sudo nano php.conf - open the file

location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}

Insert the following after index and before location, then save and restart.

Alt Text

There has been a change in Elastic beanstalk. It is now configured to nginx instead of apache so the .htaccess file no longer works. All laravel routes are getting 404 Not Found Nginx error except for the landing page.

Thread Thread
brnathanlima profile image
Nathanael Lima

Thank you for your answer but it didn't work...

Thread Thread
safventure profile image
Thread Thread
brnathanlima profile image
Nathanael Lima

Tried both but didn't work :/

Anyway, I created a brand new Laravel app and pulled a repo on it called rennokki/laravel-aws-eb and I was able to deploy without any problem. There might be something wrong in my app, not in the deployment process itself. Since it's still a small app I think that I'll recreate it...

Thanks for trying to help!

Thread Thread
safventure profile image