Deploy Laravel Application on AWS ElasticBeanstalk on Nginx Server and upload SSL certificate
First you would need to obtain the SSL certificate which you could do either from freessl.com or from AWS directly. Within your laravel application create a folder ".ebextensions". Create two files as follows:
- https-instance.config
- https-instance-single.config
- .platform/nginx/conf.d/elasticbeanstalk/extra.conf
In the https-instance.confg add the following which essentially creates and saves the certificate files on the EC2 instance through the ELB deployment.
In the https-instance-single.config add the following
In the extra.conf put the following which essentially allows the NGINX server to listen on port 443.
Note: remember to pay attention to the indentations and spaces as these are yaml files and are sensitive. They may not work if the indentations aren't correct. That should do it.
Comments