1
votes

I just deployed a Laravel App using Vapor, and received the following message. I don't believe that I changed anything (a few html blade lines).

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":{}}

The website now just shows {"message": "Internal server error"}

Did I do this, or is this a Laravel/Vapor bug?

1
It might be worth someone creating a laravel-vapor tag.Kurucu

1 Answers

1
votes

This happens when you use gateway_version 2. As per vapors documentation, you need to use an external DNS like Cloudflare for HTTPS redirection. 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.

A simple solution would be to use Gateway Version 1.