realtebo
realtebo

Reputation: 25681

How is Laravel detecting http vs https?

I have a webapp accessed via https://domain.ext

Main APP_URL in the .env is https://domain.ext

The app is behind a proxy

The problem is that generated asset url actually are prefixed with http:// instead of https://

Why ?

I triple-checked: i cleared my cache

Also i noticed that mix() urls are relative. And work But asset() generated url are using http instead of https

Please, reply to the question: how is laravel detecting https vs http?

When I understand when/how I can try to understand if my customer has a bad-configured proxy or whatelse.

Upvotes: 0

Views: 503

Answers (1)

ceejayoz
ceejayoz

Reputation: 180023

Assuming it's a well-constructed proxy that sends the right X-Forwarded-Proto headers, you'll need to configure Laravel to trust the proxy in App\Http\Middleware\TrustProxies.

Upvotes: 3

Related Questions