Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

some laravel route not changing to https

There are some my route not going to HTTPS in my Javascript code

loadSettingTable("{{ route('setting.table.data.datatable') }}");

they become like this, so my datatable can't be load because mixed content.

loadSettingTable("http://*****.com/admin/data-setting-table/datatable");

but my css and JS file already become HTTPS. I already give this on my AppServiceProvider and ENV

//AppServiceProvider.php on Boot
if(env('REDIRECT_HTTPS')) {
    $url->formatScheme('https');
    URL::forceScheme('https');
}
//.ENV
REDIRECT_HTTPS=true

But some of it work fine with this code, why my code with route name not giving https?

loadTableRealCommSumAgent("/agent/commissions-summary-member-ajax");
question from:https://stackoverflow.com/questions/65902456/some-laravel-route-not-changing-to-https

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I found the error myself, but don't really know why this error happens on my production server not staging server. I remove $url->formatScheme('https'); because it giving some error on production but not always and it's fixed my problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...