Home > Back-end >  Configuring Keyloak 18 with HTTP
Configuring Keyloak 18 with HTTP

Time:06-24

Where am I wrong? I want to run keycloak 18.0.0 server with HTTP public ip using Nginx but the page is incompletely loaded.

enter image description here

My keycloak configuration:

enter image description here

Nginx:

# .NET Core
location /api/ {
    proxy_pass         http://localhost:5001;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection keep-alive;
    proxy_set_header   Host $host;
    proxy_cache_bypass $http_upgrade;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Proto $scheme;
}

location /auth
{
    proxy_pass          http://localhost:8080/;
    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-Host   $host;
    proxy_set_header    X-Forwarded-Server $host;
    proxy_set_header    X-Forwarded-Port   $server_port;
    proxy_set_header    X-Forwarded-Proto  $scheme;
}

Obs.: I'm uploading the project from a zipped keycloak file.

CodePudding user response:

You are using context path /auth. That was default context path for Keycloak until version 16.x. You need to configure context path explicitly for Keycloak 17 . Configure hostname-path proxy pass to http://localhost:8080/auth/.

Doc: https://www.keycloak.org/server/all-config

  • Related