Laravel Vapor 部署后无法响应请求
Laravel Vapor deploys and then fails to respond to requests
我刚刚使用 Vapor 部署了一个 Laravel 应用程序,并收到以下消息。我不相信我改变了什么(几 html blade 行)。
Caching Laravel configuration{"message":"Argument 1 passed to
Symfony\Component\HttpKernel\Exception\HttpException::__construct()
must be of the type int, string given, called in
/var/task/vendor/laravel/framework/src/Illuminate/Foundation/Application.php
on line
1014","context":{"exception":{"class":"Symfony\Component\Debug\Exception\FatalThrowableError","message":"Argument
1 passed to
Symfony\Component\HttpKernel\Exception\HttpException::__construct()
must be of the type int, string given, called in
/var/task/vendor/laravel/framework/src/Illuminate/Foundation/Application.php
on line
1014","code":0,"file":"/var/task/vendor/symfony/http-kernel/Exception/HttpException.php:24"},"aws_request_id":null},"level":400,"level_name":"ERROR","channel":"production","datetime":"2019-09-27T13:18:45.338555+00:00","extra":{}}
网站现在只显示{"message": "Internal server error"}
我这样做了,还是 Laravel/Vapor 错误?
当您使用 gateway_version 时会发生这种情况 2. 根据 vapors 文档,您需要使用 Cloudflare 等外部 DNS 进行 HTTPS 重定向。 https://docs.vapor.build/1.0/projects/environments.html#gateway-versions
If you choose to use API Gateway 2.0 and would like to support HTTP to
HTTPS redirection, we currently suggest using Cloudflare as an
external DNS provider for your Vapor application. Cloudflare not only
provides DNS, but serves as a reverse proxy to your application and
features an option for automatic HTTP to HTTPS redirection.
After a Vapor deployment is completed, Vapor will provide you with
CNAME records for the domain(s) associated with your environment.
These records will point the domain to your Lambda application. You
should manually add these values as CNAME records within the
Cloudflare DNS dashboard.
In addition, when using Cloudflare, you should set your Cloudflare SSL
/ TLS mode to "Full". The "Always Use HTTPS" configuration option may
be found under the SSL / TLS menu's "Edge Certificates" tab.
一个简单的解决方案是使用网关版本 1。
我刚刚使用 Vapor 部署了一个 Laravel 应用程序,并收到以下消息。我不相信我改变了什么(几 html blade 行)。
Caching Laravel configuration{"message":"Argument 1 passed to Symfony\Component\HttpKernel\Exception\HttpException::__construct() must be of the type int, string given, called in /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 1014","context":{"exception":{"class":"Symfony\Component\Debug\Exception\FatalThrowableError","message":"Argument 1 passed to Symfony\Component\HttpKernel\Exception\HttpException::__construct() must be of the type int, string given, called in /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 1014","code":0,"file":"/var/task/vendor/symfony/http-kernel/Exception/HttpException.php:24"},"aws_request_id":null},"level":400,"level_name":"ERROR","channel":"production","datetime":"2019-09-27T13:18:45.338555+00:00","extra":{}}
网站现在只显示{"message": "Internal server error"}
我这样做了,还是 Laravel/Vapor 错误?
当您使用 gateway_version 时会发生这种情况 2. 根据 vapors 文档,您需要使用 Cloudflare 等外部 DNS 进行 HTTPS 重定向。 https://docs.vapor.build/1.0/projects/environments.html#gateway-versions
If you choose to use API Gateway 2.0 and would like to support HTTP to HTTPS redirection, we currently suggest using Cloudflare as an external DNS provider for your Vapor application. Cloudflare not only provides DNS, but serves as a reverse proxy to your application and features an option for automatic HTTP to HTTPS redirection.
After a Vapor deployment is completed, Vapor will provide you with CNAME records for the domain(s) associated with your environment. These records will point the domain to your Lambda application. You should manually add these values as CNAME records within the Cloudflare DNS dashboard.
In addition, when using Cloudflare, you should set your Cloudflare SSL / TLS mode to "Full". The "Always Use HTTPS" configuration option may be found under the SSL / TLS menu's "Edge Certificates" tab.
一个简单的解决方案是使用网关版本 1。