This post is gold and extremely helpful.
Before I was getting Bad 400 and 502 errors - all caused by hosting Home Assistant and Nginx on the same device.
A few points to add:
- Using the docker networks will disable “network_mode: host” for home assistant.
- Disabling host networking will break network discovery on home assistant
I couldn’t poke enough port holes in the container to overcome the problems without network discovery, so ultimately I had to migrate from nginx and certbot containers to swag.