Too many redirects

I have a single machine that is running three docker images: nginx reverse proxy, keycloak, and shinyproxy.

When I navigate to, it redirects to and I reach the login page. If I enter an incorrect password, the incorrect password error is displayed. If I enter a correct password, I get sent back to shinyproxy and get an ERR_TOO_MANY_REDIRECTS error. I have added the recommended forwarding environment variable to Keycloak, verified that it’s set, and set forward-headers-strategy: NATIVE for shinyproxy.

This seems to be a common problem that users have, but I have not found anything posted that actually solves the issues. Does anyone actually have this working that can share a configuration that functions?


This problem is typically caused because ShinyProxy isn’t able to verify the token provided by Keycloak. This can have multiple reasons:

  • ShinyProxy cannot reach Keycloak, e.g. because the hostname is wrong, the network access is blocked, wrong port number etc
  • ShinyProxy isn’t allowed to verify the token by keycloak, e.g. because the client-secret is wrong. If this it the case, you should see a message about this in the keycloak logs.