Right, I have a Django powered website which I am now ready to deploy into production. Except it keeps coming back with the default NGINX page - which I knew about already.
The tutorial is as follows, and I successfully accessed my website using the IPV4 address.
I have set up a Route53 in my AWS account to manage my DNS
configurations, I have an EC2 Instance & I have configured the NS
records - issued by Route52 - in the NameServer
section of Ionos (where I obtained mt domain from).
I have also conducted an A test on my Route53 and it returns no errors with with the response being my correct IPV4
address for my Amazon EC2 instance.
I have also set up an SSL certificate (with a record set up in my Route53 account for the wildcard of *.domain.com
) and set up a 443 port for https
access in my NSG.
My Django config file is as follows:
server{
listen 443; #FOR HTTPS ACCESS
server_name domain.com www.domain.com;
location / {
include proxy_params;
proxy_pass http://unix:/home/ubuntu/.ssh/xxx/app.sock;
}
}
This has been saved and the command sudo service nginx restart
was ran. I even rebooted my EC2.
My Inbound NSG rules for me EC2 instance are as follows:
8000 TCP 0.0.0.0/0
80 TCP 0.0.0.0/0
443 TCP 0.0.0.0/0
22 TCP 0.0.0.0/0
My Outbound NSG rules are as follows:
All All 0.0.0.0/0
My Route53 configurations are as follows:
domain.com A Simple - No <EC2 IPV4> -
domain.com NS Simple - No NAME RECORDS
domain.com SOA Simple - No ns-442.awsdns-55.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
_e16770634889b3410235a7c4e78692ef.domain.com CNAME Simple - No _1d0b7a786e77efdbda8a9003fdd15429.sdgjtdhdhz.acm-validations.aws.
www.domain.com A Simple - No <EC2 IPV4>
The only error logs are as follows:
2024/05/17 11:47:33 [emerg] 1248#1248: no "ssl_certificate" is defined for the "listen ... ssl" directive in /etc/nginx/sites-enabled/django.conf:1
With this in mind, why does AWS continue to show the default NGINX page despite me telling it to show my website?
server
block is respected (loaded) into your Nginx (check withnginx -T
)?