我在端口80上有 Nginx 作为 reverse_proxy 服务器,在端口5820上工作在同一台计算机上的Application Server前面。
上下文:我们正在尝试为链接数据资源提供服务,即可解除引用的URI。每当您提供资源的URL时,我们的服务器应该在您请求的任何序列化中返回有关该资源的三元组。
后面的 应用程序服务器 是保存资源及其描述(Triples)的应用程序。 Nginx 只是作为路由的前端和与之相关的其他内容(反向代理)
Application Server 可通过多个API调用使资源可用,具体取决于它所代表的资源类型。其中一个电话如下:
$ cat dat/definitions.txt
ACTE. A peninsula; the term was particularly applied by the ancients to
the sea-coast around Mount Athos.
ACT OF COURT. The decision of the court or judge on the verdict, or the
overruling of the court on a point of law.
TELEGRAPH, TO. To convey intelligence to a distance, through the medium
of signals.
TELESCOPIC OBJECTS. All those which are not visible to the unassisted
eye.
TELL OFF, TO. To divide a body of men into divisions and subdivisions,
preparatory to a special service.
TELL-TALE. A compass hanging face downwards from the beams in the cabin,
showing the position of the vessel's head. Also, an index in front of
the wheel to show the position of the tiller.
这里的URI是资源的URI。
所以要理解的是,用户会输入浏览器或通过Get调用$ uri来命令,这将触及Nginx,而Nginx将不得不重写查询以进行API调用。到目前为止,这是我为它写的规则:
$ /bin/read_def <dat/definitions.txt
word: ACTE
defn: A peninsula; the term was particularly applied by the ancients to the sea-coast around Mount Athos.
word: ACT OF COURT
defn: The decision of the court or judge on the verdict, or the overruling of the court on a point of law.
word: TELEGRAPH, TO
defn: To convey intelligence to a distance, through the medium of signals.
word: TELESCOPIC OBJECTS
defn: All those which are not visible to the unassisted eye.
word: TELL OFF, TO
defn: To divide a body of men into divisions and subdivisions, preparatory to a special service.
word: TELL-TALE
defn: A compass hanging face downwards from the beams in the cabin, showing the position of the vessel's head. Also, an index in front of the wheel to show the position of the tiller.
}
出现的一个问题是对应用程序服务器的API调用需要基本身份验证,如下面针对应用程序服务器使用Httpie所做的那样:
http://localhost:5820/IntegrationHub?graph=$uri;
我的问题是,有没有办法直接对Nginx发送/完成的服务器应用程序进行身份验证。因此,用户不必在Linked-data调用中执行此操作,但我们将在URL Rewrite scheme中为他执行此操作。