我有一个相当类似于官方提供的docker-compose文件,即:
我还有一个nginx配置文件,可以用作keycloak的反向代理。
我进一步确认了(据我所知)
到目前为止,我在文档中还没有找到解决这个问题的方法,所以非常感谢任何帮助。
version: '3'
volumes:
mysql_data:
driver: local
services:
mysql:
image: mysql:5.7
volumes:
- mysql_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: keycloak
MYSQL_USER: keycloak
MYSQL_PASSWORD: mypassword
keycloak:
image: jboss/keycloak
environment:
DB_VENDOR: MYSQL
DB_ADDR: mysql
DB_DATABASE: keycloak
DB_USER: keycloak
DB_PASSWORD: mypass
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: mypass
# It didn't look like this actually got set.
PROXY_ADDRESS_FORWARDING: "true"
ports:
- 10000:8080
depends_on:
- mysql
我还有一个nginx配置文件,可以用作keycloak的反向代理。
## Redirects all HTTP traffic to the HTTPS host
server {
listen 80;
listen [::]:80;
server_name keycloak keycloak.fqdn.com keycloak.fq.fqdn.com;
server_tokens off;
return 301 https://keycloak.fqdn.com$request_uri;
}
## HTTPS host
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name keycloak.fqdn.com;
server_tokens off;
autoindex off;
include conf.d/site-common-config/ssl.conf;
access_log /var/log/nginx/keycloak-access.log combined;
error_log /var/log/nginx/keycloak-error.log warn;
location / {
gzip on;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:10000;
}
}
我进一步确认了(据我所知)
/auth/realms/master/.well-known/openid-configuration
返回了正确的值。我一直在遵循这里的指南,并更新了相应的XML文件,运行了重新加载命令以确保proxy-address-forwarding
设置为true。然而,我收到了JavaScript错误。Load denied by X-Frame-Options: https://keycloak.fqdn.com/auth/realms/master/protocol/openid-connect/login-status-iframe.html?version=4.3.0.final does not permit framing.
到目前为止,我在文档中还没有找到解决这个问题的方法,所以非常感谢任何帮助。
allow-from https://keycloak.fqdn.com/
,但仍然收到相同的错误消息。 - undefined