docker - 为什么用 "Not authoritative"响应我的 heroku 托管容器应用程序

标签 docker kotlin heroku graalvm http4k

我尝试运行 my simple Web-App作为 Heroku 内的 Docker 容器.
在本地构建和运行容器时,一切正常。
但是在访问生成的端点时 https://html5-landingpage-buddah.herokuapp.com/ Heroku 响应 HTTP 400 错误请求和消息“不权威”
Heroku 中的日志没有多大帮助:

2020-09-19T14:45:45.269487+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=5f07ea7e-d925-4fbe-b7ba-29387a3284cc fwd="XX.XX.XX.XXX" dyno=web.1 connect=1ms service=1ms status=400 bytes=212 protocol=https
我对错误进行了研究,但没有找到有用的信息。
同样在 Heroku 中重新创建应用程序、重命名 URL 并将应用程序移动到另一个区域也无济于事。

这是从重新启动到 Web 应用程序上的第一个请求的日志:
2021-06-15T17:11:36.977277+00:00 heroku[web.1]: Starting process with command `./app`
2021-06-15T17:11:39.852345+00:00 app[web.1]: [main] INFO de.clique.westwood.example.html5.landingpage.buddah.App - Server started on port 54225
2021-06-15T17:11:39.852374+00:00 app[web.1]: [main] INFO de.clique.westwood.example.html5.landingpage.buddah.App - Serving albums from ./static/album
2021-06-15T17:11:41.363857+00:00 heroku[web.1]: State changed from starting to up
2021-06-15T17:11:48.162254+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=85c642cb-a48d-41ac-89e1-7a520749e9bc fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.275223+00:00 heroku[router]: at=info method=GET path="/" host=html5-landingpage-buddah.herokuapp.com request_id=406e9e77-f40e-47b9-a33b-af0af5b8f171 fwd="94.31.82.142" dyno=web.1 connect=1ms service=3ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.520876+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=html5-landingpage-buddah.herokuapp.com request_id=d3782734-765c-45f1-98a8-04e2098e7267 fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https
2021-06-15T17:11:48.906097+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=html5-landingpage-buddah.herokuapp.com request_id=79e4404f-e505-4c16-9778-9f72882d74be fwd="94.31.82.142" dyno=web.1 connect=1ms service=4ms status=421 bytes=219 protocol=https

最佳答案

错误 Not Authoritative只是意味着 Heroku 无法将流量从所述域名重定向到您的应用程序。
根据 Heroku ,

The web process must listen for HTTP traffic on $PORT, which is set by Heroku. EXPOSE in Dockerfile is not respected, but can be used for local testing. Only HTTP requests are supported.


您将需要更换您的 EXPOSEENTRYPOINT像这样
CMD [ "sh", "-c", "java -jar ./app --bind 0.0.0.0:$PORT" ]

关于docker - 为什么用 "Not authoritative"响应我的 heroku 托管容器应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63970138/

相关文章:

javascript - Discord.js没有播放YouTube网址

python - 使用 Docker 在 Raspberry pi 中安装 Noetic 时出现的问题

docker - 如何在Kubernetes中定义网络

ruby-on-rails - Ruby on Rails 和 Heroku "App Crashed"

android - 从 Kotlin 中的构造函数注入(inject) Koin

android - 错误 : supertypes of the following classes cannot be resolved. 请确保您在类路径中有所需的依赖项

node.js - Heroku 默认的 Node.js 应用程序

docker - 从存储库中删除所有 Docker 镜像

docker - 如何在没有sudo的情况下允许Docker权限创建目录?

kotlin 检查可为空的 bool 值如何工作?