Deploying Laravel App to Elastic Beanstalk with Runtime 2

Deploying Laravel App to Elastic Beanstalk with Runtime 2

Deploying Laravel to Elastic Beanstalk with Runtime 2 (PHP 7.4)

Deploying Laravel to Elastic Beanstalk with Runtime 2 (PHP 7.4)

If you recently tried to deploy a Laravel app to elastic beanstalk using nginx + PHP 7.4 then you must know that whenever you try to access any of your app routes it will throw an 404 error.

Image for post

Well, this happens because the latest elastic beanstalk runtime uses nginx as default web server in replacement of Apache, the one being use in the oldest versions.

A lot of users just decide to ditch php 7.4 and go back to php 7.2 with the older runtime and problem solved. Well you don’t need to.

How do I fix this?

All you have to do is create this file

.platform/nginx/conf.d/elasticbeanstalk/

And inside of it, paste your regular try_files directive.

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

Then commit / deploy it using your regular** eb deploy **or using a zip file. This will automatically make your routes work properly again.

And of course, you can add any other directives inside this file. Just be careful about what elastic beanstalk supports.

elastic-beanstalk aws php nginx laravel

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

How to Use AWS Elastic Beanstalk to Reduce Risk of Deployment Downtime

You can use AWS Elastic Beanstalk to create and deploy an updated or upgrated application version with blue-green deployment using cloned configs. Learn How to Use AWS Elastic Beanstalk to Reduce Risk of Deployment Downtime.

Php how to delete multiple rows through checkbox using ajax in laravel

In this article i will let you know to delete multiple rows through checkbox using ajax in laravel and before delete we will give a confirmation message.

How to Install Laravel PHP Framework with Nginx on Ubuntu 20.04

Laravel is the most popular, free, and open-source PHP framework in the world, known for its expressive and elegant syntax. Laravel is accessible, powerful, and offers some of the best web development tools required for large, robust, and modern applications. In this article, you will learn how to install the Laravel PHP Framework on Ubuntu 20.04 server running on the Nginx web server.

Setup a VM for Laravel 8 with Ubuntu 20.04, PHP 8, Nginx and MySQL

Learn how to setup a GNU/Linux VM with Ubuntu 20.04 LTS, PHP8, Nginx and MySql to serve a Laravel 8 Application. For the Web Server I’m going to use Nginx so I will need php-fpm.

How to add on-screen logging to your Flask application and deploy it on AWS Elastic Beanstalk

Hint: don’t forget to configure the Nginx reverse proxy server. In this tutorial, you'll see How to add on-screen logging to your Flask application and deploy it on AWS Elastic Beanstalk