小编Hil*_*jem的帖子

目标组 443 给出的运行状况检查失败,代码如下:[502]

我想将 Laravel 网站部署到亚马逊,所以我执行了以下步骤:

  • 使用 Elastic Beanstalk 部署 Laravel 应用程序
  • 配置Route:53实例指向Ec2的IP
  • 创建了具有两个侦听器的应用程序负载均衡器,其中一个侦听器位于 80,另一个侦听器位于 443
  • 创建2个目标组Tg80和Tg443并分别指定监听者
  • 请注意,Tg443 具有有效的 SSL 证书

  • 将 Ec2 的安全组更改为负载均衡器的安全组

  • 将 Route:53 中的 A 实例更改为负载均衡器的实例

**结果: **

  • 该网站在 http 端口 80 上完美运行,健康检查也是如此,我可以从任何浏览器正常访问该网站

  • 该网站在 https:443 上返回 [502 Bad Gateway]

  • 在(ssh 到实例后)/var/log/httpd/error_log 中,出现以下错误/var/www/html/.htaccess: RewriteCond: bad flag delimiters

所以,我尝试了,根据链接enforce-https-laravel

  • .htaccess按照链接中所述在 laravel 应用程序中进行配置,请刷新所有内容 `php artisan config:cache,重试运行状况检查,但结果相同

  • 我删除.htaccess并配置了app/Providers/AppServiceProvider.php

    use Illuminate\Contracts\Routing\UrlGenerator; 

    public function boot(UrlGenerator $url)
    {
       if(env('ENFORCE_SSL', false)) {
         $url->forceScheme('https');
       }
    }
Run Code Online (Sandbox Code Playgroud)
  • 然后添加ENFORCE_SSL=true …

amazon-web-services laravel aws-application-load-balancer

3
推荐指数
1
解决办法
2585
查看次数

Laravel 8 使用 Guards Rest 密码进​​行多重身份验证问题

我正在尝试使用守卫制作一个具有多重身份验证的 Laravel 应用程序。

Github: 存储库

我创建了一个新的 Laravel 8 应用程序并添加了管理员防护,现在我可以在管理员和用户模式下登录和注销。

这张图片显示了我所做的详细信息,您可以跳过并阅读下面的管理员重置密码部分 详情图片

配置/auth.php:

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Authentication Defaults
    |--------------------------------------------------------------------------
    |
    | This option controls the default authentication "guard" and password
    | reset options for your application. You may change these defaults
    | as required, but they're a perfect start for most applications.
    |
    */

    'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

    /*
    |--------------------------------------------------------------------------
    | Authentication Guards
    |--------------------------------------------------------------------------
    |
    | Next, you may define every authentication guard …
Run Code Online (Sandbox Code Playgroud)

php authentication laravel laravel-8

1
推荐指数
1
解决办法
3244
查看次数