RStudio Server only loads when using app_direct

If I try to load RStudio Server using:

https://app.domain.com/app/rstudio

I get a blank white screen and an error message in the console:

The page at ‘https://app.domain.com/app_i/rstudio/’ was loaded over HTTPS, but requested an insecure frame ‘http://app.domain.com/app_direct_i/rstudio/auth-sign-in?appUri=%2F’. This request has been blocked; the content must be served over HTTPS.

But I can load using app_direct:

https://app.domain.com/app_direct/rstudio

How can I resolve this issue?

I managed to solve this by moving this:

server:
  forward-headers-strategy: native

outside proxy (i.e. as a top level block).

This thread helped: