amazon-web-servicesnginxnginx-reverse-proxynginx-config

Nginx ip configuration issue


I'm trying to deploy my django web site to nginx on my amazon ec2 server but could not succeed so far. I have done all the steps on my local computer and managed to make it work. But when it comes to my server I have tried every possible things that I know but no luck so far. Also when I run python3 manage.py runserver 0.0.0.0:8000 I'm able to access to my website through the amazon ec2 public ip address like http://11.53.22.62:8000/. So probably I have configured something wrong.

The url that I'm trying to access is for example : http://11.53.22.62:8070 (my amazon ec2 public ip)

Here is my configurations: nginx.conf

events {}

pid /home/ubuntu/projectmicroven/var/nginx.pid;

http {
    error_log /home/ubuntu/projectmicroven/var/nginx.error.log warn;
    access_log /home/ubuntu/projectmicroven/var/nginx.access.log;

    server {
        server_name 11.53.22.62;
        listen 8070;


        root /home/ubuntu/projectmicroven/www/public/;

        location /static/ {
            alias /projectmicroven/www/public/;
            include /etc/nginx/mime.types;
        }

        location / {
            proxy_pass http://127.0.0.1:8081;
        }
    }
}

gunicorn.conf.py

workers=2
errorlog="/home/ubuntu/projectmicroven/var/microven.gunicorn.error.log"
accesslog="/home/ubuntu/projectmicroven/var/microven.gunicorn.access.log"
loglevel="debug"

bind =["127.0.0.1:8081"]

Anyone has any idea? Thanks in advance.


Solution

  • Please make sure port 8070 is allowed on Security group on AWS.