Laravel Octane 502 Bad Gateway When Machine Starts

Hey there!

This does in fact appear to be an issue of Nginx sending a request to Octane before Octane has started.

In fact, it’s sending the request before Octane is able to listen for requests, so increasing timeouts in Nginx doesn’t even work (Nginx just sees it as nothing being there, rather than sometime is listening but not responding in time).

So, I’ve devised a fix that appears to work. It’s not my favorite fix, but I’m asking around to see if there’s something better (not just on X :stuck_out_tongue: )

Here’s what I did:

  1. Updated the Nginx config with The Fix™
  2. Over-wrote the Nginx config loaded by the Dockerfile

I’ve included a gist bc typing it all out here is very noisy, but you can try this out.

1 Like