$site->url() returns http:// and not https://


I have set up a site on an Azure web app and for some reason when I use $site->url() it returns a http:// address and not a https:// address.

It runs on an nginx server and it is set to force https, so everything works, but I still get an mixed content warning since the request is done with http.
This is mostly an annoyance and not a critical error, but it would be great to get rid of the mixed content warnings.

So the question is, where does $site->url() actually get the address from?

Please take a look at this reference page:

Thank you so much! Exactly what I needed. Somehow I was unable to find this in the docs.