FilamentF
Filament15mo ago
johny7

Filament favicon is not embedded via https

Hello everyone.

I use the directive ->favicon(asset('/images/favicon.png')) in my panel. When I call my panel in the local environment, the favicon is provided and included as expected.
On my prod server (on fly.io), however, the favicon is strangely included via Http, although the entire app is provided via HTTPS. All other assets (CSS, JS, laravel and filament) are included relative or via absolute path with HTTPS.

What is the reason for this and how can I change it? My browser understandably does not want to display a favicon integrated via a different protocol.

I have already tested re-build and filament upgrade. If I call asset('/images/favicon.png') once on my fly.io instance via SSH in artisan tinker, I also get the path including HTTPS.

If I see it correctly, the behavior occurred after the introduction of multi-tenancy. As a result, I had to reconfigure some routes. Could it be somehow related to this? And how can I debug or fix this correctly?

My routing configuration currently looks like this:
Route::get('{tenant}/image/{model}/{field}/{id}', [App\Http\Controllers\ImageController::class, 'show'])->name('image');
Route::redirect('{tenant}/aktuelle-probe', '/{tenant}/proben/' . (App\Models\Probe::current()?->id));


Many thanks in advance for your help!
Johannes Nazarov
Solution
Try modifying the ASSET_URL env var. If that doesn't work try adding a force HTTPS in a service provider depending on your apps environment. https://stackoverflow.com/a/51819095
Stack Overflow
I am working on a project that requires a secure connection.

I can set the route, uri, asset to use 'https' via:

Route::get('order/details/{id}', ['uses' => 'OrderController@details', 'as' =&g...
Was this page helpful?