Skip to content

Commit

Permalink
fix: enable reverse proxy configuration for Keycloak (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
neumanf authored Sep 20, 2024
1 parent d97040a commit 0362bf2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ services:
KC_METRICS_ENABLED: 'true'
KC_HOSTNAME_STRICT_HTTPS: 'false'
KC_HOSTNAME_URL: ${KEYCLOAK_URL}
KC_PROXY: reencrypt
KC_PROXY: edge
KC_PROXY_HEADERS: xforwarded
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
depends_on:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ services:
KC_METRICS_ENABLED: 'true'
KC_HOSTNAME_STRICT_HTTPS: 'false'
KC_HOSTNAME_URL: ${KEYCLOAK_URL:-http://0.0.0.0:9090}
KC_PROXY: reencrypt
KC_PROXY: edge
KC_PROXY_HEADERS: xforwarded
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
depends_on:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ services:
KC_METRICS_ENABLED: 'true'
KC_HOSTNAME_STRICT_HTTPS: 'false'
KC_HOSTNAME_URL: ${KEYCLOAK_URL:-http://0.0.0.0:9090}
KC_PROXY: reencrypt
KC_PROXY: edge
KC_PROXY_HEADERS: xforwarded
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
depends_on:
Expand Down
5 changes: 5 additions & 0 deletions infra/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,10 @@ server {

location / {
proxy_pass http://keycloak:8080;

proxy_set_header X-Forwarded-For $proxy_protocol_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port 443;
}
}

0 comments on commit 0362bf2

Please sign in to comment.