By mendax23
Hi,
I added the domain to allowed hosts already like that:
ALLOWED_HOSTS = ["161.35.74.202", "*.example.de", "example.de"]
code
This is how my nginx sites available file looks like:
server {
listen 80;
server_name 161.35.74.202 example.de;
code
I am really frustrated right now because I cant find the mistake here. I tried a lot and would be really really grateful for an advice. Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @mendax23,
Please change the allowed hosts from
ALLOWED_HOSTS = ["161.35.74.202", "*.example.de", "example.de"]
To
ALLOWED_HOSTS += ["161.35.74.202", "*.example.de", "example.de"]
You need to use += rather than just = so that it appends everything after the first entry.
Please try with that and see if you would get the proper outcome.
Additionally, I noticed the same question has been answered here - https://www.digitalocean.com/community/questions/400-error-bad-request-when-visiting-domain-name-ip-address-loads-fine
You may want to go through it, it might provide some other good suggestions.
Regards, KDSys
Try server_name 161.35.74.202 .example.de;
With this dot before example.de it uses *.example.de and example.de
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.