在herkou上部署laravel时出现问题(混合内容) [英] I have problem when deploy my laravel on herkou (Mixed Content)
问题描述
你好...我完成了使用Laravel和jQuery构建网站并进行引导的操作,但是在本地运行良好,但是当我将jQuery和Bootstrap文件上传至Heroku时…在本地使用http进行了操作,但是在Heroku中需要https无法运行但是当写HTTP替代https时,它可以像本地一样正常工作并显示不安全..".现在,任何人都知道我如何在Heroku中允许使用https的网站或如何选择此问题
Hello … l am finish Building website using Laravel and jQuery and bootstrap it's working good in local but when I upload to Heroku the file jQuery and bootstrap not working … it's work in local using http but in Heroku its need https its not working but when write http substitute of https it's working good like local and display Not Secure .. now any body know how can i allow website using https in Heroku or How can selection this problem
推荐答案
我本人早有此问题,有一些选择,有些比其他方法更为繁重.如果您想确保所有内容始终都是https,没有例外,请首先将您的APP_URL
更新为' https://example.com ",然后在AppServiceProvider的启动方法中添加Url::forceScheme('https');
Had this issue myself awhile back, there are a few options and some are more heavy handed than others. If you want to gauruntee that everything is always https no exceptions first update your APP_URL
to 'https://example.com' then in the boot method of your AppServiceProvider add Url::forceScheme('https');
较少使用的选项是查找使用asset()
帮助器的所有位置,并将其更改为secure_asset
.资产助手应该使用您的APP_URL知道请求为https,但是根据我的经验,我不能依赖于此,因此请使用secure_asset来确保
The less heavy handed option is to find all of the places you use the asset()
helper and change it to secure_asset
instead. The asset helper should use your APP_URL to know the request is https but in my experience I couldn't rely on that so use secure_asset to make sure
这篇关于在herkou上部署laravel时出现问题(混合内容)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!