Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Asset Class to Return HTTPS URL Link
  • Quick question about the Asset class. Is there a way to configure the return string URL to use HTTPS. By default it returns as insecure. Thank you in advance.

    // returns something like 'http://example.org/assets/js/jquery.js'
    echo Asset::get_file('jquery.js', 'js');
  • Harro VertonHarro Verton
    Accepted Answer
    It depends on the asset URL configured in your asset.php config file, and/or the config you pass when you forge an asset instance. 

    By default it just uses "/", which means it uses the scheme and host information of the page the asset is used on.

    So if your website is https://example.org, the assets should have that too...
  • Okay I see. I think the trouble is that I am terminating the SSL with a proxy (Nginx) and handing off the request to a container also running Nginx, but without SSL. So will have to find a way to deal with this scenario
  • I fixed it. Kind of hacky but in the public facing Nginx a am forwarding the request to the container on port 443 but without the SSL encryption. 
  • In that case you need to set the base_url to https, so all links are explicitly generated with it.

    Never had any issue with it, all our apps are behind a WAF that offloads SSL too.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion