Hi!
I want to run a Keycloak instance so that it is available via
http://myproduct.local. For now I want to try it out locally.
To do this, I wrote the following NGINX configuration file:
START
server {
listen 80;
server_name myproduct.local;
location /keycloak {
proxy_pass http://host.docker.internal:8103/;
}
location / {
proxy_pass http://host.docker.internal:8081;
}
}
}END
Then, I launch Nginx and Keycloak using the following docker-compose.yaml file:
START
version: '3.7'
services:
router:
image: nginx:1.23.3
ports:
- 80:80
volumes:
- ./site.conf:/etc/nginx/conf.d/site.conf
app-x:
image: app-x
ports:
- 8081:80
app-y:
image: app-y
ports:
- 8082:80
app-z:
image: app-z
ports:
- 8083:80
keycloak:
container_name: keycloak-2
image: quay.io/keycloak/keycloak:20.0.1
ports:
- "8103:8080"
- "443:8443"
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
command:
- start-dev --hostname=http://myproduct.local/keycloakEND
The "router" uses the site.conf file shown above.
When I open the URL
http://myproduct.local/keycloak in the browser,
a) the images, styles etc. are not present on the page and
b) I cannot access the admin console (I am redirected to
http://host.docker.internal:8103/admin/ ).
What do I need to change in the site.conf and/or docker-compose.yaml file in order to fix these issues?
Thanks in advance