Repository navigation
Has anybody succeeded in exposing just the recommended paths in Nginx? #13655
Unanswered
ayoubAnbara
asked this question in
Q&A
Replies: 1 comment
|
This is what I use, it matches up with the recommended exposed paths for Keycloak 18. The admin console and other sensitive endpoints are only accessible through a bastion server.
server {
listen 80;
listen [::]:80;
server_name localhost;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location /auth {
try_files $uri @proxy;
}
location ~ /auth/(admin|health|metrics|welcome) {
allow <BASTION_CIDR>; #Allow traffic from bastion server access to admin console - set this accordingly
deny all;
try_files $uri @proxy;
}
location @proxy {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_pass https://localhost:8443;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
As the documentation said:
"When using a reverse proxy, Keycloak only requires certain paths need to be exposed"
So I am looking for someone who has configured Nginx, and respected these recommendations, to share with us Nginx configuration.
This is my Nginx configuration:
Thanks
All reactions