【问题标题】:Jekyll App in Google App Engine throws error 502 Bad GatewayGoogle App Engine 中的 Jekyll 应用程序抛出错误 502 Bad Gateway
【发布时间】:2018-12-31 01:12:53
【问题描述】:

我正在尝试在 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,但似乎没有任何效果。我做错了什么?

谢谢!

【问题讨论】:

    标签: ruby google-app-engine jekyll


    【解决方案1】:

    解决方案是将主机名设置为 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"

    【讨论】:

    • 很好地找到了解决方案!你知道你可以接受自己的答案吗?
    猜你喜欢
    • 1970-01-01
    • 2021-03-31
    • 2021-10-02
    • 1970-01-01
    • 2016-11-13
    • 2018-11-12
    • 1970-01-01
    • 1970-01-01
    • 2020-08-27
    相关资源
    最近更新 更多