0
votes

I'm trying to deploy a simple Jekyll app in Google App Engine and it keeps throwing a 502 Bad Gateway error. This is my code: https://github.com/voiladt/voiladt.github.io

When I launch it from the GC console it works perfectly, I simply use: bundle exec jekyll serve -P 8080.

But when I deploy it with gcloud app deploy it takes a very long time (about 30 minutes) and the resulting website throws a 502 error from nginx.

The logs don't seem to be of much help:

... 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

I've tried replacing the hostname to localhost and to 0.0.0.0, but nothing seems to work. What am I doing wrong?

Thanks!

1

1 Answers

0
votes

The solution was to set the hostname to 0.0.0.0 and the port to 8080.

I had tried 0.0.0.0 before, but I had the default port (4000 for jekyll).

To set the port: In the app.yaml, set entrypoint: bundle exec jekyll serve -P $PORT.

To set the hostname: In _config.yaml, set host: "0.0.0.0".