在 Heroku 中使用支持 HTTP2 的 actix-web
Using actix-web with HTTP2 support in Heroku
我正在尝试部署在 Heroku 中提供 HTTP/2 支持的 one of the actix-web 示例,在稍微修改它以侦听提供的 $PORT
号码之后,以及在 Heroku 中的方式加载了哪些证书——它不是从文件中读取,而是从环境中获取 public 和私钥。
问题是,在每次请求时,Heroku 路由器都会记录连接已关闭而没有响应。
heroku[router]:
at=error
code=H13
desc="Connection closed without response"
method=GET
status=503
bytes=0
protocol=https
因为它在本地工作,我怀疑问题出在我的 dyno 配置上,这是一个业余爱好($7/mo),尤其是在证书部分。由于应用程序希望从环境变量中接收证书信息,并且 Heroku 不向您提供访问其证书的权限(例如 xxxxx.herokuapp.com 的证书),因此我购买了一个域名,希望能生成自己的域名。我做到了,使用 following page.
使用自行生成的证书,到目前为止我已经尝试了以下操作,导致出现以下错误的任何一种情况:
- 为测功机和应用程序提供同一对钥匙。日志产生上述错误。
- 不是给dyno提供SSL配置,而是给应用程序。因此,
https
访问被禁用,甚至连测功机都没有被击中。
- 不是为应用程序提供证书配置,而是为测功机提供证书配置。应用程序在启动时崩溃。
但是,如果我删除相关的 rustls
行,一切都会顺利进行,但使用的协议是 HTTP/1.1
。
因此,我想请教您:
- 让应用程序期望加载证书有什么根本上不好的地方吗?
- 我应该尝试其他供应商吗? (例如 DigitalOcean、AWS、Google 云)
- 你知道是什么让它在 Heroku 中工作吗?
刚刚发现Heroku当时不支持HTTP/2(source):
HTTP/2 is not currently supported on Heroku although this may change in future. You can find out about our currently supported HTTP protocols here: https://devcenter.heroku.com/articles/http-routing#http-versions-supported
For any future developments we recommend subscribing to the Heroku Changelog. This will let you know about updates, improvements and deprecations ahead of time so that you can make any necessary adjustments.
我正在尝试部署在 Heroku 中提供 HTTP/2 支持的 one of the actix-web 示例,在稍微修改它以侦听提供的 $PORT
号码之后,以及在 Heroku 中的方式加载了哪些证书——它不是从文件中读取,而是从环境中获取 public 和私钥。
问题是,在每次请求时,Heroku 路由器都会记录连接已关闭而没有响应。
heroku[router]:
at=error
code=H13
desc="Connection closed without response"
method=GET
status=503
bytes=0
protocol=https
因为它在本地工作,我怀疑问题出在我的 dyno 配置上,这是一个业余爱好($7/mo),尤其是在证书部分。由于应用程序希望从环境变量中接收证书信息,并且 Heroku 不向您提供访问其证书的权限(例如 xxxxx.herokuapp.com 的证书),因此我购买了一个域名,希望能生成自己的域名。我做到了,使用 following page.
使用自行生成的证书,到目前为止我已经尝试了以下操作,导致出现以下错误的任何一种情况:
- 为测功机和应用程序提供同一对钥匙。日志产生上述错误。
- 不是给dyno提供SSL配置,而是给应用程序。因此,
https
访问被禁用,甚至连测功机都没有被击中。 - 不是为应用程序提供证书配置,而是为测功机提供证书配置。应用程序在启动时崩溃。
但是,如果我删除相关的 rustls
行,一切都会顺利进行,但使用的协议是 HTTP/1.1
。
因此,我想请教您:
- 让应用程序期望加载证书有什么根本上不好的地方吗?
- 我应该尝试其他供应商吗? (例如 DigitalOcean、AWS、Google 云)
- 你知道是什么让它在 Heroku 中工作吗?
刚刚发现Heroku当时不支持HTTP/2(source):
HTTP/2 is not currently supported on Heroku although this may change in future. You can find out about our currently supported HTTP protocols here: https://devcenter.heroku.com/articles/http-routing#http-versions-supported
For any future developments we recommend subscribing to the Heroku Changelog. This will let you know about updates, improvements and deprecations ahead of time so that you can make any necessary adjustments.