Forum

FYI fix for mixed content problem

Posted in CategoryGeneral
  • Marco
    Marco Dings   ( User ) 1 week ago

    I have setup akauntin in docker countainer using nginx proxy that adds letsencrypt and servers the site using https.

    Wich recents browers becomming more and more "defensive" they object against .css, js resources being loaded through http ( and not https )

    regardless of the setting of APP_URL in the .env
    APP_URL=https://asdfadsf
    the application renders recources with http://

    the culprit seems to be the usage of 
        asset('
    where
      secure_asset('

    seems to be the better choice

    After searching for quite some time i found a solution in modifying
      ./app/Providers/AppServiceProvider.php

    modify the boot() by adding
       \URL::forceScheme('https');


    for me that results in 

        public function boot()

        {

            // Laravel db fix

            Schema::defaultStringLength(191);

            \URL::forceScheme('https');

        }


    Its a "harcoded" one-line hack that is obviously ONLY going to work when https is enabled. It however makes akaunting usable again untli a proper solution is implemented

    Marco

Please login or register to leave a response.