ERROR Failed to validate sign-in with invalid CSRF form

Hiya all,

I have just installed RStudio Server on a remote Ubuntu server, and I have not been able to log into it at all. Everytime I tried logging in, I got "Error: RStudio Sign In Failed". I created another local account to sign in and I am still unable to login.

This is what was logged in rserver.log:
[rserver] ERROR Failed to validate sign-in with invalid CSRF form; LOGGED FROM: bool rstudio::server::auth::common::validateSignIn(const rstudio::core::http::Request&, rstudio::core::http::Response*) src/cpp/server/auth/ServerAuthCommon.cpp:136

I have also used pamtester to see if there is any authentication problem and so far there were no issues authenticating 2 local accounts.

For context: I am using Nginx to serve the server. I'm not sure if the issue is related to PAM itself, or how I set up Nginx. I'll be very grateful if someone could chime in.

Charlie.