PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By

dev

Unsolved

Subject: Issue with Loading Assets over HTTPS in Voyager

dev85

Apr 3rd, 2024 03:18 AM

Hello,

Our team is facing an issue with loading assets over HTTPS in the back-office part of our application using the Wave boilerplate, which is managed by Voyager. We managed to resolve a similar issue in the front-office part by adding an ASSET_URL environment variable. However, when we access the /admin page, we encounter the problem of assets loading over HTTP instead of HTTPS again.

We have tried several approaches to solve this issue, but none have been successful so far. Here is a summary of what we have attempted:

- Checking and adjusting the APP_URL configuration in the .env file to ensure it uses https://.
- Forcing HTTPS in the AppServiceProvider via URL::forceScheme('https').
- Configuring our web server (Apache/Nginx) to systematically redirect HTTP requests to HTTPS.

Despite these efforts, the assets loaded from the Voyager /admin part continue to use the HTTP protocol, causing mixed content warnings in browsers.

I was wondering if you had ever encountered this problem or if you could offer any advice on how to handle it. Any help or direction would be greatly appreciated to ensure our application operates securely under HTTPS without mixed content warnings.

Thank you in advance for your time and assistance.

Have a great day!

bobbyiliev

Apr 3rd, 2024 01:16 PM

Hey!

I tried to replicate this behaviour on my end, but I was only able to do so when setting the APP_URL in my .env file to http://mydomain.com.

Once I've changed the APP_URL to https://mydomain.com the mixed content warnings disappeared.

Did you by any chance also run php artisan config:clear after changing your APP_URL?

If you still can get this to work and if you can share your server credentials with me, I'm happy to troubleshoot this for you further!

roberrtt1211

Apr 5th, 2024 01:58 AM

Thanks for these insights mate as I was looking for this only