简体   繁体   English

AWS Elastic Beanstalk 中 Laravel 的自定义 nginx 配置

[英]Custom nginx configuration for Laravel in AWS Elastic Beanstalk

Hi I am using AWS elastic beanstalk for my Laravel application您好,我正在为我的 Laravel 应用程序使用 AWS elastic beanstalk

When I first uploaded my application it is not showing the login page, 404 error so I tried with app_url/index.php/login and it worked当我第一次上传我的应用程序时,它没有显示登录页面,404 错误所以我尝试使用 app_url/index.php/login 并且它有效

This is how I figure out I need to add this to my Nginx configuration, I manually added this, ssh into ec2 instance, and worked这就是我如何弄清楚我需要将它添加到我的 Nginx 配置中,我手动将它 ssh 添加到 ec2 实例中,并且工作

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

but every time I deploy my new code it replaces my manual code但每次我部署新代码时,它都会替换我的手动代码

I also read https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-tomcat-proxy.html?icmpid=docs_elasticbeanstalk_console this doc and created this folder structure in my application root folder我还阅读了 https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-tomcat-proxy.html?icmpid=docs_elasticbeanstalk_console这个文档并在我的应用程序根文件夹中创建了这个文件夹结构

.ebextensions
  nginx
    conf.d
      elasticbeanstalk
        my-server-conf.conf

Seems not working for me Please let me know what should I put In my-server-conf.conf file and what should I do so it works for every deploy似乎对我不起作用请让我知道我应该在 my-server-conf.conf 文件中放什么以及我应该做什么以便它适用于每次部署

You should be using .platform , not .ebextensions as explained in aws docs .您应该使用.platform ,而不是aws docs中解释的.ebextensions For example:例如:

.platform/nginx/conf.d/elasticbeanstalk/laravel.conf

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS Elastic Beanstalk + Laravel、Nginx配置 - AWS Elastic Beanstalk + Laravel, Nginx Configuration 如何在 Tomcat AWS Elastic beanstalk (Spring Boot Application) 中修改或添加新的 Nginx 配置 - How to modify or add new Nginx configuration in Tomcat AWS Elastic beanstalk (Spring Boot Application) 在 AWS elastic beanstalk 上安装 nginx 模块 - Install nginx module on AWS elastic beanstalk 在 AWS Elastic Beanstalk 中找不到 Laravel API 路由 - Laravel API routes not found in AWS Elastic Beanstalk Laravel 和 AWS Elastic Beanstalk 网站不工作? - Laravel and AWS Elastic Beanstalk website not working? 为什么 AWS Elastic Beanstalk 没有传递自定义 JWT? - Why is AWS Elastic Beanstalk not passing the custom JWT? 访问在 AWS Linux 上运行的 NGINX 配置中的 Elastic Beanstalk 环境属性 2 - Access Elastic Beanstalk environment properties in NGINX configs running on AWS Linux 2 在 AWS Elastic Beanstalk 上重新请求 - Resque on AWS Elastic Beanstalk 如何在 AWS Elastic Beanstalk 上设置和使用 Laravel 调度? - How do I setup and use Laravel Scheduling on AWS Elastic Beanstalk? 将 Laravel 应用程序部署到 AWS Elastic Beanstalk 时出现“403 Forbidden”错误 - Getting a '403 Forbidden' error on deploying a Laravel application to AWS Elastic Beanstalk
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM