giorg
1 year ago

haproxy - ssl

Posted 1 year ago by giorg

hello,

I've successfully set up ubuntu/haproxy with letsencrypt, which forwards requests to a lxd container with my app. My problem now is the app is serving http instead of https, how can I force it? I tried already:

set the ip into the $proxies variable if the TrustProxies midlleware
created my own middleware handling the request:

if (!$request->secure() && App::environment() === 'production') { return redirect()->secure($request->getRequestUri()); }

        return $next($request); 

put this in boot function of AppserviceProvider:

URL::forceScheme('https');

without luck. Any further hint?

thanks a lot

Please sign in or create an account to participate in this conversation.