dockergithubdocfxcodespaces

GitHub Codespaces 502 Gateway Error Serving a docfx site


I am working to add GitHub Codespaces to the NUnit docs repository for document editing. We're really excited about the potential of Codespaces for our use case!

The Current Ingredients

Reproduction

Expected Behavior

See the site at the root site at the /_site subdirectory which is where docfx serves items

Actual Behavior

See a 502 bad gateway error at the initial URL, and also when attempting with /_site appended.

Other Things I've tried


Solution

  • I figured it out! Thanks to this comment: https://github.com/dotnet/docfx/issues/3615#issuecomment-451664865

    In this case, because docfx is using WebApp.Start(), the correct syntax inside of the container is:

    docfx serve _site -n "*"

    That "*" is what makes the difference here and allows mono to bind appropriately for the forwarding to work.