我在一个生产环境中有这个错误。仅在某些路线上,我认为有效的路线与少数无效的路线之间没有区别。我所有的路由都在 web.php 中,前面我尝试通过 Vuejs/Axios 访问。此外,当我尝试访问它们时,两个 url 都来自错误,我得到 https://,即使我尝试 http://,我也会重定向到 https。
我到目前为止所尝试的。
.env
APP_URL=https://my.url
网页.php
URL::forceScheme('https'); //at the top of the file
应用程序/提供者/AppServiceProvider
public function boot()
{
URL::forceScheme('https');
}
还:
composer dump-autoload
php artisan cache:clear
php artisan config:clear
php artisan view:clear
php artisan route:clear
php artisan config:cache
npm run prod