0

I am building a reverse proxy with NGINX that controls the access to a three docker containers which contain a little App I've developed. This proxy can only be accessed by an apy-key authorized by Kong with the key-auth plugin. The scheme is something like this:

Scheme of my system

If the clients don't have the api-key the request is denied. It seems to be working, but I have a problem with the static css files. From the browser I can access the application, but the CSS and JS does not load because they don't send the api-key in the request. For this reason I get a 401 HTTP unauthorized response when the browser tries to load the styles:

GET http://localhost:8000/myapp/r2/docs/stylesheets/library.css[HTTP/1.1 401 Unauthorized 1ms]
message "No API key found in request"

So my app is loading in the browser without styles. These are my style headers in the app:

  <link href="myapp/r2/docs/stylesheets/library.css" rel="stylesheet" type="text/css">

How can I send my api-key to load the styles and js too?

Danubio
  • 93
  • 8

0 Answers0