so I am very much new to the docker world. Currently facing this "502 Bad Gateway" error when trying to proxy pass to a keycloak container. I can't seem to understand the cause of the error. Below are my codes which I have written:
proxy.conf
file
server{
listen 80;
location / {
proxy_pass http://myapp;
}
}
Dockerfile
FROM nginx:alpine
RUN rm etc/nginx/conf.d/*
COPY proxy.conf etc/nginx/conf.d/
docker-compose file
version: '3'
services:
nginx_app:
build: .
container_name: nginxapp
ports:
- "9000:80"
depends_on:
- myapp
myapp:
image: jboss/keycloak:latest
container_name: myapp
ports:
- "8443"
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
What I am trying to do is that when I hit host-ip:9000
it should pass it to keycloak screen. But looks like something's wrong. Grateful for any help. Thanks