Skip to content

Commit a0e2fbc

Browse files
committed
chore: experimental do not use auth subpath
1 parent 056c2e9 commit a0e2fbc

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

compas/docker-compose-postgresql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ services:
3333
compas: true
3434
ports:
3535
- "8089:8080"
36-
- "8080:8080"
36+
# - "8080:8080"
3737
environment:
38-
- KC_HOSTNAME=${COMPAS_HOSTNAME}
39-
- KC_HTTP_RELATIVE_PATH=auth
38+
- KC_HOSTNAME=http://${COMPAS_HOSTNAME}
39+
# - KC_HTTP_RELATIVE_PATH=auth
4040
- KC_HTTP_ENABLED=true
4141
- KC_PROXY_HEADERS=xforwarded
4242
volumes:

compas/reverse-proxy/authenticate.include

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
access_by_lua_block {
22
local opts = {
33
redirect_uri = "http://##COMPAS_HOSTNAME##/redirect_uri",
4-
discovery = "http://keycloak:8080/auth/realms/compas/.well-known/openid-configuration",
4+
discovery = "http://keycloak:8080/realms/compas/.well-known/openid-configuration",
55
client_id = "openscd",
66
redirect_uri_scheme = "http",
77
logout_path = "/logout",
8-
redirect_after_logout_uri = "http://##COMPAS_HOSTNAME##/auth/realms/compas/protocol/openid-connect/logout?redirect_uri=http%3A%2F%2F##COMPAS_HOSTNAME##%2F",
8+
redirect_after_logout_uri = "http://##COMPAS_HOSTNAME##/realms/compas/protocol/openid-connect/logout?redirect_uri=http%3A%2F%2F##COMPAS_HOSTNAME##%2F",
99
redirect_after_logout_with_id_token_hint = false,
1010
session_contents = {id_token=true, access_token=true},
1111
renew_access_token_on_expiry = true,

compas/reverse-proxy/nginx.conf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,34 @@ http {
6363
proxy_redirect off;
6464
}
6565

66+
# Forwarding to KeyCloak container 2.
67+
location /realms/ {
68+
proxy_set_header X-Real-IP $remote_addr;
69+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
70+
proxy_set_header X-Forwarded-Proto $scheme;
71+
proxy_set_header X-Forwarded-Port $server_port;
72+
73+
proxy_pass http://keycloak:8080/realms/;
74+
75+
proxy_set_header Host $http_host;
76+
proxy_cache_bypass $http_upgrade;
77+
proxy_redirect off;
78+
}
79+
80+
# Forwarding to KeyCloak container resources.
81+
location /resources/ {
82+
proxy_set_header X-Real-IP $remote_addr;
83+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
84+
proxy_set_header X-Forwarded-Proto $scheme;
85+
proxy_set_header X-Forwarded-Port $server_port;
86+
87+
proxy_pass http://keycloak:8080/resources/;
88+
89+
proxy_set_header Host $http_host;
90+
proxy_cache_bypass $http_upgrade;
91+
proxy_redirect off;
92+
}
93+
6694
# Forwarding to the SCL Validator Service container (websockets).
6795
location /compas-scl-data-service/scl-ws/ {
6896
include /etc/nginx/include/authenticate.include;

0 commit comments

Comments
 (0)