keycloak 11.0.2 版本使用https

生成 SSL 证书

生成私钥:

bash 复制代码
openssl genpkey -algorithm RSA -out privateKey.pem -pkeyopt rsa_keygen_bits:2048

生成证书签名请求 (CSR):

bash 复制代码
openssl req -new -key privateKey.pem -out certificate.csr

生成自签名证书:

bash 复制代码
openssl x509 -req -days 365 -in certificate.csr -signkey privateKey.pem -out certificate.crt

配置 Nginx 代理

bash 复制代码
server {
    listen 8080;
    listen 443 ssl;
    server_name localhost;
    
    ssl_certificate certificate.crt;
    ssl_certificate_key privateKey.pem;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    
    location / {
        proxy_pass http://keycloak.demofor.cn:8080;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port $server_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect http://$scheme://;
    }
}
相关推荐
学习中的DGR13 小时前
[极客大挑战 2019]Http 1 新手解题过程
网络·python·网络协议·安全·http
hjhcos14 小时前
【宝塔】局域网IP申请SSL证书,解决浏览器本地环境可以访问摄像头,发布环境不能访问摄像头的问题
网络协议·tcp/ip·ssl
Gensors传感器16 小时前
Gensors解读:TCP/IP协议在压力扫描系统中的作用详解
网络·网络协议·tcp/ip·压力测试·压力扫描阀·扫描阀
我送炭你添花16 小时前
树莓派部署 GenieACS 作为终端TR-069 ACS(自动配置服务器)的详细规划方案
运维·服务器·网络协议
LuminescenceJ17 小时前
GoEdge 开源CDN 架构设计与工作原理分析
分布式·后端·网络协议·网络安全·rpc·开源·信息与通信
我在人间贩卖青春17 小时前
UDP协议
网络·网络协议·udp
卓码软件测评18 小时前
【第三方软件测试测评机构:使用LoadRunner测试HTTPS/SSL协议应用的配置和证书处理 】
网络协议·测试工具·https·测试用例·ssl
七夜zippoe18 小时前
gRPC高性能RPC框架实战:从Protocol Buffers到流式传输的完整指南
网络·python·网络协议·rpc·protocol
一路往蓝-Anbo18 小时前
第 1 篇:对象池模式 (Object Pool) —— 裸机下的动态内存革命
jvm·数据库·stm32·单片机·嵌入式硬件·网络协议·tcp/ip