Funkwhale behind 2 chained nginx reverse-proxies : Invalid HTTP_HOST header error, Bad Request (400) error
Hello there and thanks for all your hard work.
Background: I'm building a Funkwhale setup that is meant to go public. A bunch of Debian 10 VM's under a KVM hypervisor, Debian 10 everywhere. Non-Docker setup, only plain good ol' VMs.
So the from-outside-requests path is as follows :
PUBLIC_IP -> KVM_hypervisor (NAT) --> nginx_frontend_proxy (tcp 80/443) --> nginx_web_frontend (funkwhale-FQDN) -> Funkwhale
I managed the biggest part of the set-up (thanks to the forum!) but I'm still struggling with what it seems to be a bug or maybe a configuration mistake on my side, I guess it has something to do with the API IP and the nginx's upstream parameters: so I have a Bad Request 400 error, blank page. The logs say:
audio-01 gunicorn[917]: 2020-04-01 19:17:55,276 django.security.DisallowedHost ERROR Invalid HTTP_HOST header: '127.0.0.1:5868'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.
avril 01 21:17:55 audio-01 gunicorn[917]: 2020-04-01 19:17:55,336 django.request WARNING Bad Request: /
avril 01 21:17:55 audio-01 gunicorn[917]: 2020-04-01 19:17:55,338 uvicorn.access INFO 86.250.170.222:0 - "GET / HTTP/1.1" 400
Funkwhale LAN IP is 192.168.10.9. Any setting I tried, along in the .env file and the upstream funkwhale-api parameter for nginx get me to that Bad Request (400) error.
I tried different IPs: 192.168.10.9, 127.0.0.1, 0.0.0.0, each time restarting nginx and all Funkwhale services, no gain.
At the moment I have this, in .env file:
FUNKWHALE_API_IP=127.0.0.1
FUNKWHALE_API_PORT=5868
And in nginx's funkwhale.conf:
upstream funkwhale-api {
# depending on your setup, you may want to update this
server 127.0.0.1:5868;
}
Do you have any clue? I don't see any othererror logs except that one. Any help much appreciated, don't hesitate to ask for more info/ logs/whatever. Thanks!