Google App Engine 中的 Jekyll App 抛出错误 502 Bad Gateway

Jekyll App in Google App Engine throws error 502 Bad Gateway

我正在尝试在 Google App Engine 中部署一个简单的 Jekyll 应用程序,但它一直抛出 502 Bad Gateway 错误。这是我的代码:https://github.com/voiladt/voiladt.github.io

当我从 GC 控制台启动它时,它运行良好,我只需使用:bundle exec jekyll serve -P 8080

但是当我用 gcloud app deploy 部署它时需要很长时间(大约 30 分钟)并且生成的网站从 nginx 抛出 502 错误。

日志似乎没有太大帮助:

... Configuration file: /app/_config.yml Invalid theme folder: _includes Source: /app Destination: /app/_site Incremental build: disabled. Enable with --incremental Generating... Jekyll Feed: Generating feed for posts Build Warning: Layout 'post' requested in _posts/2018-12-30-welcome-to-jekyll.markdown does not exist. Build Warning: Layout 'page' requested in about.md does not exist. done in 0.767 seconds. Auto-regeneration: enabled for '/app' Server address: http://127.0.0.1:8080/ Server running... press ctrl-c to stop. "GET /" 502 "GET /" 502 "GET /" 502

我尝试将主机名替换为 localhost0.0.0.0,但似乎没有任何效果。我做错了什么?

谢谢!

解决方案是将主机名设置为 0.0.0.0,将端口设置为 8080。

我之前尝试过 0.0.0.0,但我有默认端口(jekyll 为 4000)。

设置端口:在app.yaml中设置entrypoint: bundle exec jekyll serve -P $PORT

要设置主机名:在 _config.yaml 中,设置 host: "0.0.0.0"