Timshrok
Timshrok

Reputation: 107

Unable to Integrate keyrock with nginx, css and js files not loading

I wanted to access keyrock idm using nginx reverse proxy. But while doing so, nginx is unable to load the css and js files.

    location /idm/{

    proxy_pass           https://keyrock-host:keyrock-port/;
    proxy_set_header   X-Forwarded-Host    $host;
    proxy_set_header    Host                $host;
    proxy_set_header    X-Real-IP            $remote_addr;
    proxy_set_header    X-Forwarded-For        $proxy_add_x_forwarded_for;
    }

I am facing the following issue:

enter image description here

enter image description here

I tried doing somechanges but wasn't successful.

Upvotes: 0

Views: 215

Answers (1)

MRROOX
MRROOX

Reputation: 1

Fiware Management

Idm KeyRock

This is a temporary solution, but it is not a definitive solution. Keyrock does not work properly in subdirectories.

I think you should implement that feature.

location /fiware-idm/ {
    proxy_set_header    X-Forwarded-Host   $host;
    proxy_set_header    Host               $host;
    proxy_set_header    X-Real-IP          $remote_addr;
    proxy_set_header    X-Forwarded-For    $proxy_add_x_forwarded_for;
    rewrite ^/fiware-idm(/.*)$  $1 break;
    
    proxy_pass http://keyrock:3005;
    proxy_redirect / /fiware-idm/;
    sub_filter '="/' '="/fiware-idm/';
    sub_filter '= "/' '= "/fiware-idm/';
    sub_filter '=\'/' '=\'/fiware-idm/';

    sub_filter_once off;
}

location /idm {
    proxy_pass http://keyrock:3005;
    sub_filter_once off;
}

location /img {

    proxy_pass http://keyrock:3005;
    sub_filter_once off;
}

Upvotes: 0

Related Questions