400 Bad request after adding static ip

Hi, I’m hosting a demo Django application on an AWS Lightsail instance. It was working correctly at the original assigned IP address, but the documentation recommended adding a static IP address, which I did (it’s I can SSH into the instance using that IP, and the ipv4 firewall rules are set to allow HTTP on port 80 and HTTPS on 443.

But since making that change, I keep getting 400 Bad Request when I try to access the site. I first tried setting ALLOWED_HOSTS=[‘’]. When that didn’t work, I tried temporarily setting ALLOWED_HOSTS=[‘*’] and DEBUG=True, but still am getting 400 Bad Request.

I can still use manage.py runserver to run the app while in an SSH session and access the app in a second SSH session using lynx When I do that, I see the expected ‘hello world’ http response.

I’d appreciate any help in how to troubleshoot this. I think AWS support will just give me a link to the same documentation I’ve been following.


I’m not sure why, but after a couple hours it started working correctly. During that timeframe, I didn’t make any changes to the Django app, but I added a letsencript certificate to apache, and after completing that process, I restarted services sudo /opt/bitnami/ctlscript.sh restart. I’m guessing it was just that I needed to restart services to get the Django site to resolve at the static IP.