Hi Alex,
Am not using SAML. RStudio does a POST-redirect for login. That's the redirect am talking about.
Yes, I submitted a support ticket as well. And resolved the issue by looking at RStudio code.
Found issue in the way RStudio figures out if it is behind proxy at https://github.com/rstudio/rstudio/blob/51009f4cff7b0f45f9bd8762d7c0514b0de537bd/src/cpp/core/http/Request.cpp#L62
Instead of getting proxied base URI, it gets internal URI.
The protocol is then taken from 'X-RStudio-Proto' header than 'X-Forwarded-For' header.
Solved my issue by adding setting 'X-RStudio-Proto' header to https in nginx.site.conf.