Kong没有使用Auth-Key插件加载静态CSS文件
我正在使用NGINX建立反向代理,该代理控制对三个Docker容器的访问,该容器中包含我开发的小应用程序。此代理只能由Kong授权的APY-KEY访问键-auth插件。该方案是这样的:
如果客户端没有API-KEY,请求被拒绝。它似乎在起作用,但是我对静态CSS文件有问题。从浏览器中,我可以访问该应用程序,但是CSS和JS不会加载,因为它们不会在请求中发送API-KEY。因此,当浏览器试图加载样式时,我会得到401 HTTP未经授权的响应:
GET http://localhost:8000/myapp/r2/docs/stylesheets/library.css[HTTP/1.1 401 Unauthorized 1ms]
message "No API key found in request"
因此,我的应用程序正在加载浏览器,没有样式。这些是该应用程序中的样式标题:
<link href="myapp/r2/docs/stylesheets/library.css" rel="stylesheet" type="text/css">
我如何发送我的API-KEY也加载样式和JS?
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:
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论