Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By Alex Yang
The site loads when I visit the droplet IP address and domain.com.
When I go to www.domain.com, Chrome reports:
This site can’t be reached
www.domain.com’s server IP address could not be found."
When I try *.domain.com, for instance dog.domain.com or giggles.domain.com, it responds with Bad Request (400). Same responses on MS Edge.
I’ve followed these links, amongst others:
How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 16.04 How To Set Up and Test DNS Subdomains with DigitalOcean’s DNS Panel Subdomains not working with Digital Ocean DNS settings Why isn’t my site available via the www prefix?
I’m trying to deploy a Mezzanine 4.2.3 CMS using Ubuntu 16.04.3, Python 3.5.2, gunicorn, and nginx. I elected not to use the fabfile.py provided by Mezzanine because it didn’t work and I couldn’t figure out all the things that I had to attend to get it right. It was far easier to get domain.com running with the first DigitalOcean tutorial linked above.
I’ve placed the IP address, domain.com, *.domain.com, and www.domain.com in ALLOWED_HOSTS in local_settings.py (temporarily; will follow two scoops best practices once I get a better handle on deployment):
ALLOWED_HOSTS = [
"domain.com",
"*.domain.com",
"www.domain.com",
"IP address",
]
I’ve also placed them in /etc/nginx/sites-available/project:
server {
listen 80;
server_name [IP address] domain.com *.domain.com www.domain.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/project;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/project/project.sock;
}
}
I’ve added an A record for domain.com pointing to the IP address of the droplet and it’s successful. When I go to the IP address or domain.com, the site shows.
Fearing conflicts, I tried these permutations:
Scenario 1:
A:domain.com, *.domain.com
Scenario 2:
A: domain.com, www.domain.com
Scenario 3:
A: domain.com, www.domain.com, *domain.com
Scenario 4:
A: domain.com
CNAME: *.domain.com
Scenario 5:
A: domain.com
CNAME: www.domain.com
Scenario 6:
A: domain.com, *.domain.com
CNAME: *.domain.com
Scenario 7:
A: domain.com, www.domain.com
CNAME: www.domain.com
Scenario 8:
A: domain.com, *.domain.com, www.domain.com
CNAME: *.domain.com
Scenario 9:
A: domain.com, *.domain.com, www.domain.com
CNAME: www.domain.com
Scenario 10:
A: domain.com, *.domain.com, www.domain.com
CNAME: *.domain.com, www.domain.com
Scenario 11:
A: domain.com
CNAME: *.domain.com, www.domain.com
The results were the same for all 11 scenarios. I am leaving things at Scenario 11.
Along the way, I pinged the IP address, domain.com, *.domain.com, and www.domain.com from the command line. It’s always successful for the IP address, domain.com, and even *.domain.com. They invariably got a reply from the IP address. However, the response for www.domain.com:
Ping request could not find host www.domain.com. Please check the name and try again.
When I tried host <domain.com/www.domain.com/*.domain.com> +trace, it traced all the way down properly.
When I tried host <domain.com/www.domain.com/*.domain.com> ns1.digitalocean.com, it gave me the correct IP address.
I’m out of ideas. What could I have missed?
dolphinnn
Vaishnavi Vundyala
016512ea60864da0867e5280f293de
Peter Monadjemi
Prince7hakur
devjk1
fc9acbfbc3124cbf8df28a1c5c5cdb
ab871885551143798f41908c709271
gouskova
Saivion Services
Marin
182d09356ab94d3893ddfaca4f0270