正如 Kinto 文档中所写,我可以通过这种方式指定自定义配置:
docker run --env-file ./kinto.env -p 8888:8888 kinto/kinto-server
.
此外,我似乎可以建议使用该属性的 http 方案。http_scheme
现在,如果我:
- 放入文件
KINTO_HTTP_SCHEME=https
;kinto.env
- 通过上面的命令运行 Kinto,并且;
- 转到https://example.com:8888/v1/;
我得到一个空白页。
附加信息
如果我改为导航到http://example.com:8888/v1/,我会在页面上获得通常的 JSON 配置。此 JSON 还包含一个url
属性,即https://example.com:8888/v1/(而不是http://example.com:8888/v1/),所以似乎正在发生一些事情:.env
文件已被读取。该链接是可点击的,但如果我点击它,我仍然会得到一个空白页面。
这是一个错误吗?我该如何解决?
笔记
这很重要,因为如果页面是通过 https 提供的,Chrome 将不允许我提供 http 内容。它完全阻止了请求,在控制台中显示了适当的错误:d Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure resource 'http://example.com:8888/v1/'. This request has been blocked; the content must be served over HTTPS.
金托 说:Fetch API cannot load http://example.com:8888/v1/. Failed to start.
Error: HTTP 0; TypeError: Failed to fetch(…)