We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello Mr. Wes I have docker-compose.yml as following
version: '3.7' services: nginx: image: 'nginx:1.19.3' container_name: 'nginx' networks: - 'frontend' - 'backend' depends_on: - 'keycloak' ports: - '80:80' volumes: - './etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro' app: build: context: 'app' container_name: 'app' networks: - 'backend' expose: - '8000' environment: - 'ISSUER_URL=http://localhost/keycloak/realms/app' - 'AUTH_URL=http://localhost/keycloak/realms/app/protocol/openid-connect/auth?client_id=app&response_type=code&redirect_uri=http://localhost/auth/callback' - 'TOKEN_URL=http://localhost/keycloak/realms/app/protocol/openid-connect/token' - 'USERINFO_URL=http://localhost/keycloak/realms/app/protocol/openid-connect/userinfo' - 'JWKS_URL=http://localhost/keycloak/realms/app/protocol/openid-connect/certs' entrypoint: ['python3'] command: ['app.py'] keycloak: image: 'jboss/keycloak:11.0.2' container_name: 'keycloak' restart: 'always' environment: - 'KEYCLOAK_USER=${KEYCLOAK_USER}' - 'KEYCLOAK_PASSWORD=${KEYCLOAK_PASSWORD}' - 'DB_VENDOR=postgres' - 'DB_ADDR=postgres' - 'DB_PORT=5432' - 'DB_DATABASE=keycloak' - 'DB_USER=admin' - 'DB_PASSWORD=${POSTGRES_PASSWORD}' - 'PROXY_ADDRESS_FORWARDING=true' - 'KEYCLOAK_IMPORT=/realm-export.json' depends_on: - 'postgres' networks: - 'backend' expose: - '8080' - '9990' command: - '-b=0.0.0.0' - '-Djboss.http.port=8080' volumes: - './opt/jboss/startup-scripts:/opt/jboss/startup-scripts' - './realm-export.json:/realm-export.json' postgres: image: 'postgres:13.0-alpine' container_name: 'postgres' restart: 'always' environment: - 'POSTGRES_DB=keycloak' - 'POSTGRES_USER=admin' - 'POSTGRES_PASSWORD=${POSTGRES_PASSWORD}' networks: - 'backend' expose: - '5432' volumes: - 'postgres:/var/lib/postgresql/data' networks: frontend: backend: volumes: postgres:
and I have nginx.conf as following
user nginx; worker_processes 1; error_log /var/log/nginx/error.log debug; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; upstream keycloak { server keycloak:8090 max_fails=3; } upstream app { server app:8000 max_fails=3; } server { listen *:80; server_name _; location /healthz { stub_status; } location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; proxy_pass http://app; } location /login { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://app; } location /auth/callback { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://app; } location /keycloak { proxy_pass http://127.0.0.1:8090/keycloak/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /keycloak/admin { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://keycloak; } location /keycloak/realms/master { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://keycloak; } } }
When I go to localhost/keycloak I've receive 502 Bad Gateway. Please could you tell me what I've done wrong
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello Mr. Wes
I have docker-compose.yml as following
and I have nginx.conf as following
When I go to localhost/keycloak I've receive 502 Bad Gateway.
Please could you tell me what I've done wrong
The text was updated successfully, but these errors were encountered: