I use nginx on the main server (not in a container) with simple reverse proxy (not well versed on reverse proxies but this worked fine on my other containers so assumed it would here too…) with Keycloak(v23.0.1) running from a docker container.
What have I done wrong to have Keycloak displaying the port when I go to the admin page?
Below is what is displaying (note that the Keycloak site works as normal apart from displaying the port number in the browser)
By going to keycloak.tld.com I end up at https://keycloak.tld.com:58443/admin/master/console/#/master/users
(port added)
The port is the right port, set both in the nginx config and in the docker run config…
Below is my nginx config:
server {
server_name keycloak.tld.com;
access_log /var/log/nginx/keycloak.access.log;
error_log /var/log/nginx/keycloak.error.log;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_pass https://localhost:58443;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/keycloak.tld.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/keycloak.tld.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = keycloak.tld.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name keycloak.tld.com;
listen 80;
return 404; # managed by Certbot
}
What have I missed?
rcwombat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.