【发布时间】:2020-04-04 06:25:04
【问题描述】:
问题:我正在尝试自定义由 kong 生成的 nginx 配置以提供静态内容以及我的 api as described here。我可以生成 nginx.conf 文件,但对于我的一生 - 我无法让我的简单 HTML 被提供。
我做了什么:我创建了一个最小的docker-compose,它重现了我的问题here。我在这里尝试了各种组合,我普遍得到相同的结果:
{"message":"no Route matched with those values"}
我能看到的唯一相关日志是:
2020/04/04 06:20:11 [warn] 49#0: *11361 using uninitialized "kong_proxy_mode" variable, client: 127.0.0.1, server: kong, request: "GET /index.html HTTP/1.1", host: "localhost:8000"
2020/04/04 06:20:11 [warn] 49#0: *11361 using uninitialized "ctx_ref" variable, client: 127.0.0.1, server: kong, request: "GET /index.html HTTP/1.1", host: "localhost:8000"
2020/04/04 06:20:11 [warn] 49#0: *11361 [lua] reports.lua:75: log(): [reports] unknown request scheme: http while logging request, client: 127.0.0.1, server: kong, request: "GET /index.html HTTP/1.1", host: "localhost:8000"
我尝试将root 移出location,使用alias 而不是root,传递主机标头,更改server_name,以及其他一千件事我不记得了。
我相信问题在于here,但我目前不知道。我认为这是问题所在,因为如果我将正文更改为,我可以让它返回文本:
location / {
return 200 'huh?';
}
任何帮助都会让我的生活恢复几年。
编辑
我stripped out everything 除了location / 和location /api/ 的基本要素之外,这是可行的——所以我可以尝试从这里开始寻找原因。
编辑 this commit 似乎包含重大更改,但我不清楚重大更改是什么。
【问题讨论】: