Why my domain works only when I type this: example.com. with a "dot" and without "www" and in any other condition I get 400 error:
http://example.com./ - it works
http://www.example.com/ - it doesn't work
http://www.example.com./ - it doesn't work
Error I get:
GET http://www.example.com./ 400 (Bad Request)
I use: django, aws, route53, ec2, ubuntu, nginx, gunicorn
I set up:
elastic IP for my instance and connnect to my instance.
In hosted zone I did like in tutorial:
Record name: example.com Record type: A Value: my IP Alias: No TTL (seconds): 300 Routing policy: Simple
and
> Record name:
> www.example.com
> Record type:
> A
> Value:
> example.com.
> Alias:
> No
> TTL (seconds):
> 900
> Routing policy:
> Simple
3)Nginx conf:
```
server {
listen 80 default_server;
server_name example.com www.example.com myIP;}
```
then restart:
```
sudo systemctl restart nginx
sudo service gunicorn restart
sudo service nginx restart
```
Settings.py:
ALLOWED_HOSTS = [ 'example.com','myIP', ]
Thanks in advance!