My Django app is located @ www.name-of-app.rhcloud.com
Through dns-provider.com
I own: www.name-of-app.com
The CName setup is as follows:
name-of-app.com
redirects to www.name-of-app.com
, www.name-of-app.com
is setup as a CNAME alias to www.name-of-app.rhcloud.com
Now if I try to access www.name-of-app.com from any browser I receive a 'Bad Request (400)' error.
I have played around with the following settings:
www.name-of-app.com
to www.name-of-app.rhcloud.com
, but then after switching back to a CNAME I am met with the same error.www.name-of-app.com
-a myAppIf I run the host command from my devel station I see that the alias is correctly set up.
cmd: host www.name-of-app.com(first 2 lines of output are listed below):
www.name-of-app.comis an alias for
name-of-app.rhcloud.com.
name-of-app.rhcloud.comis an alias for
ex-std-nodeXXX.prod.rhcloud.com`.
I am working with dns-provider.com
, but they haven't raised any issues to this point.
How can I get this CNAME issue resolved? It seems to be out of my control and beyond my domain of expertise at the given moment.
Ironically enough the issue turned out to be a Django related problem (someone removed the Django mail list). Clearly I didn't provide enough information to know that however.
The issue lies in the fact that the CNAME was not enabled in my ALLOWED_HOSTS settings. Upon adding it to the ALLOWED_HOSTS setting, I was able to access the site as expected.
Cheers.
@Ibn Saeed (I don' t have enough reputation to answer, with a comment) I had the same issue and solved it adding to ALLOWED_HOSTS the exact domain name leaving it like this
ALLOWED_HOSTS = [
'.mydomain.com.',
'mydomain.com'
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With