Keycloak config on AWS EC2

295 views
Skip to first unread message

Sri Harsha Bhasuru

unread,
Nov 8, 2022, 7:52:04 PM11/8/22
to Keycloak User
Hi All,

I am new to keycloak and having issues when I am trying to set it up on AWS EC2. When running keycloak in localhost in dev & prod mode with self signed certificate it worked well.

I have a domain(newbuilt.com) in Route53 in AWS, on an EC2 I have an NGINX which is running on port 80 which is mapped to an ALB. I started Keycloak on the EC2 in prod mode using a self signed certificate and it throws error for HTTPS access.

Can you help on how I can setup keycloak on AWS with the domain certificate I have in ACM or any other way?


Message has been deleted

Sri Harsha Bhasuru

unread,
Nov 8, 2022, 9:44:59 PM11/8/22
to Keycloak User
I tried with reverse proxy using the below settings when I access over ALB I see below error any guidance will be helpful

Error.png

NGINX CONF:

     location /auth{
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_protocol_addr;
                proxy_set_header X-Forwarded-Proto $scheme;
                add_header Access-Control-Allow-Origin *;
                proxy_pass http://localhost:9005;
        }

export KC_HTTP_ENABLED=true

export KC_PROXY=edge

export KC_HOSTNAME_STRICT_HTTPS=false

export PROXY_ADDRESS_FORWARDING=true


Keycloak start command:  ./kc.sh start --db-url-host=rds.amazonaws.com --db-username=user --db-password=******* --db-url=jdbc:postgresql://rds.amazonaws.com:5432/postgres --hostname-strict=false --proxy=edge --http-port=9005
Reply all
Reply to author
Forward
0 new messages