This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

abass
abass

Since integrating SSL (HTTPS) across all my OctoberCMS sites, I have noticed that the backend is linking all the way back to the http:// url with absolutely everything instead of just starting the links at /modules/backend/ or /system/backend. (This is for importing CSS, JS, general links, etc.)

The problem with this is that no CSS or JS loads when visiting the backend when on an SSL connection (which I now have forced across my site using CloudFlare) because it is forcing http links over an https connection. I had this same problem on some of my Laravel based projects and all I had to do to fix it was inside of app --> filters.php I just had to put in:

App::before( function( $request ){
  // set the current IP (REMOTE_ADDR) as a trusted proxy
  Request::setTrustedProxies( [ $request->getClientIp() ] );
});

Now this doesn't seem to work with OctoberCMS and I can't for the life of me find a way to force https:// over http:// for all of the CSS & JS files that are imported into the project on the backend.

Would really appreciate any ideas/suggestions as I have been searching around and trying to fix this problem for days now.

I mean really, they are all local files, why does the framework even have the entire site URL anyway? Instead of having http://site.com/modules, why not just have it do /modules by default and then you won't have any of those pesky SSL problems with local files..

Thanks!

Last updated

demagu
demagu

app/config/app.php -> url - did you set it to https?

abass
abass

Appreciate the response demagu, I changed it from http:// to https:// but it didn't seem to do anything. It's still calling in the links as http://.

I feel like it's gotta be some really minor setting, I don't see why this functionality would be broken out of the box?

a5548
a5548

We're having issues with the same thing. If someone could point us in the right direction, that'd be grand.

abass
abass

@a5548 only solution is to let your voice be heard on this github issue I maded a few weeks back. Samuel is aware of the problem and is asking for opinions on how link policy should be handled.

https://github.com/octobercms/october/issues/856#issuecomment-71149845

Just leave a message letting him know that you are also encountering the problem and recommend the relative route. That would fix the problem as files being called relatively inherit whether the site is SSL or non-SSL automatically. It's the best solution.

iabsis
iabsis

I know this is an old issue, but as it seems there is no solution founded yet, we made a fix by creating a very small plugin.

http://iabsis.com/fr/community/resources/plugin-october-https-reverse-proxy-ready

abass
abass

info5539 said:

I know this is an old issue, but as it seems there is no solution founded yet, we made a fix by creating a very small plugin.

http://iabsis.com/fr/community/resources/plugin-october-https-reverse-proxy-ready

Appreciate that! I'll definitely check it out. Unfortunately in it's current place, the only way to get SSL working properly is by purchasing and installing a proper SSL Certificate onto your site and then doing a "Strict SSL Connection" within CloudFlare. There's currently no way to use "Flexible SSL" within CloudFlare and use OctoberCMS. I'll definitely check out your plugin and see if it fixes this. Thanks for your work!

till
till

I know this is an old thread but for anyone having the same issue, I can confirm iabsis's plugin ( http://iabsis.com/fr/community/resources/plugin-october-https-reverse-proxy-ready ) and making the following changes in the cms.php config file makes it work fine for me:

'linkPolicy'=>'insecure',

'backendForceSecure'=>false,

Thanks, iabsis!

Last updated

jpruiz11424571
jpruiz11424571

I can confirm that using this plugin:

http://iabsis.com/fr/community/resources/plugin-october-https-reverse-proxy-ready

... and setting linkPolicy = insecure and backendForceSecure = false inside the cms.php config file does the trick to solve this issue.

1-9 of 9

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.