Closed sfgabe closed 2 years ago
I'm guessing your docker-compose.yaml looks similar to this?
services:
app:
environment:
- CSRF_TRUSTED_ORIGINS=http://localhost:8000
- DJANGO_SETTINGS_MODULE=babybuddy.settings.base
image: ghcr.io/linuxserver/babybuddy
ports:
- '8000:8000'
If so, I'm able to reproduce the issue:
http://localhost:8000/api/
returns: {"children":"http://localhost/api/children/","changes":"http://localhost/api/changes/","feedings":"http://localhost/api/feedings/","notes":"http://localhost/api/notes/","sleep":"http://localhost/api/sleep/","temperature":"http://localhost/api/temperature/","timers":"http://localhost/api/timers/","tummy-times":"http://localhost/api/tummy-times/","weight":"http://localhost/api/weight/","height":"http://localhost/api/height/","head-circumference":"http://localhost/api/head-circumference/","bmi":"http://localhost/api/bmi/"}
.
I think the problem may be here:
When I change the LSIO nginx.conf from proxy_set_header Host $host;
to proxy_set_header Host $http_host;
, all works as expected:
{"children":"http://localhost:8000/api/children/","changes":"http://localhost:8000/api/changes/","feedings":"http://localhost:8000/api/feedings/","notes":"http://localhost:8000/api/notes/","sleep":"http://localhost:8000/api/sleep/","temperature":"http://localhost:8000/api/temperature/","timers":"http://localhost:8000/api/timers/","tummy-times":"http://localhost:8000/api/tummy-times/","weight":"http://localhost:8000/api/weight/","height":"http://localhost:8000/api/height/","head-circumference":"http://localhost:8000/api/head-circumference/","bmi":"http://localhost:8000/api/bmi/"}
I am going to open a PR with LSIO and see what they think.
Thanks all.
@jcgoette great catch! I haven't even thought about the Lsio docker image having a nginx proxy as well...
Let's hope on a quick merge! Thanks for your help!
@jcgoette i tried out the potential fix from https://github.com/linuxserver/docker-babybuddy/pull/19 but sadly it does not fix the problem on my side.
I also had the same error when trying to call a service through the internal docker network, which previously worked:
Cannot connect to host babybuddy:80 ssl:default [Connect call failed ('172.20.0.2', 80)]
After modifying my docker compose to the following, service calls began working as expected.
ports:
- '8000:8000'
- '80:80'
I still have this issue with the most recent update from lsio. Anyone else?
Yeah this is still broken in Baby Buddy v1.10.2-ls33
ls33 is from 4/17. This fix looks like it was put on https://github.com/linuxserver/docker-babybuddy/releases/tag/v1.10.2-ls36.
Sorry, still a problem with v1.10.2-ls37 as well (have I mentioned how much I hate Docker versioning and "tags"? 😄)
I tried explicitly exposing port 8000 on the babybuddy container to no effect. I cannot expose port 80 (already in use), nor would I want to.
I am running 1.10.2-ls36 just FYI
I mistakenly thought the PR would fix this automatically. You will still need to take some action. See links below:
Manually changing the mounted file /config/nginx/site-confs/default
and restarting the container fixes the problem! thanks everyone!
Can you confirm what you changed? Appreciated
I mounted /config
as a volume of the container and the change from this commit: https://github.com/linuxserver/docker-babybuddy/pull/19/files in the file /config/nginx/site-confs/default
.
I updated baby buddy and home assistant at the same time so I'm not sure which one is the culprit, but services stopped working as of the 1 April home assistant update.
Happen to anyone else? Any ideas what it could be?