When using Keycloak in a development environment, all the connections to your app, database, and Keycloak are made on your internal network. When you put your app into production, then your users may well be accessing your Keycloak server from outside your network. This is especially true when developing Single Page Applications SPA’s.
It is common practice to run the Keycloak server over HTTP behind a reverse proxy, which in turn provides your users with the HTTPS connection to keep their credentials private. This is where problems can start to arise with mixed content error messages.
The solution is quite straight forward and requires only the addition of two environment variables to the Keycloak Service in the docker-compose.yaml file.
The two environment variables you need to add are
A full example of a docker-compose.yaml is shown below to give you some context.
Let me know in the comments how you get on and subscribe to my medium channel to get notified of new full-stack development articles.