aws beanstalk 403 error while deploying

Generally we have two ways to solve this issue:

Let's think you uploaded a zip file with folder named test. So after you uploaded it unzips the file and it pushes all the files into the folder named test.

So to access it we have 2 ways:

1st way: Get the url from aws elastic bean console and add your folder name at the end Ex: http://xyz-env-1.yahdasdsd.us-east-2.elasticbeanstalk.com/test/index.php

2nd way: Go to your EBS Console -> configuration -> software -> edit add /test in Document Root If we do that http://xyz-env-1.yahdasdsd.us-east-2.elasticbeanstalk.com works fine


If your laravel project is in a folder called AppFolder for instance on your local drive, do not generate your zip file by rightclicking on AppFolder. Use the below instead.

Open the AppFolder, highlight all files (includes your public folder) and select to add to anyName.zip (anyName can be AppFolder also). Upload this anyName.zip to your Beanstalk environment.

You may change the document root to '/public' go to EBS console>Application>configuration>Software configuration and change the "Document root" under "container options"


Credit to Rakesh Bollampally:

I think your application is inside a folder. If that is the case, change the EBS configuration for document root or have a file in root to redirect to that sub folder. To Change document root, go to EBS console>Application>configuration>Software configuration and change the "Document root" under "container options"