I am deploying my django app with AWS EC2, Gunicorn with supervisor and Nginx. I have religiously followed tutorials but my incompetence prevent me to spot where I am mistaken. When connecting to my IP address or my domain name I get an error saying that they cannot be reached or it tryes to connect and then says “took too long to connect”
I am thinking it has to issues related with hosts because in development the app works like a charm
settings.py
ALLOWED_HOSTS = ALLOWED_HOSTS = ['xxx.xxx.xxx.xxx', '127.0.0.1', 'mysite.com','www.mysite.com']
they also are set up in /etc/hosts/.
My nginx configuration:
server {
listen 80;
server_name xxx.xxx.xxx.xxx mysite.com www.mysite.com;
location / {
include proxy_params;
proxy_pass http://unix:/home/ubuntu/exostocksaas/app.sock;
}
location /static {
autoindex on;
alias /home/ubuntu/exostocksaas/inventory4/collected_static/;
}
}
and this is my gunicorn configuration:
[program:gunicorn]
directory=/home/ubuntu/exostocksaas
command=/home/ubuntu/Exos/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/exostocksaas/app.sock in$
autostart=true
autorestart=true
stderr_logfile=/var/log/gunicorn/gunicorn.err.log
stdout_logfile=/var/log/gunicorn/gunicorn.out.log
user=root
[group:guni]
programs:gunicorn
And I have also configurate my EC2 instance to also accept trafic from port 8000.
when I run runserver 0.0.0.0:8000 (i know its not recommanded but just to test and launch the IP address on port 8000, I get 404 error.
At this point I am feeling a little bit lost and not sure where to look for the issue. Would someone has a clue about how to handle the situation?