Search code examples
djangoubuntunginxserver

502 bad gateway error with django , gonicorn in ubuntu server


i got these error 502 bad gateway

when cheched error.log i got

when i checked goicorn

the nginex services is run but after check i got this error enter image description here

this is my code in nginx/site-avalable

upstream keepalive-upstream {
    server 127.0.0.1:8000;
    keepalive 64;
}

    server {
        listen 80;
        listen [::]:80;
        server_name qhse-erp.com www.qhse-erp.com;
    
     location / {
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_pass http://keepalive-upstream;
        proxy_redirect off;
    
    }
    }

i has starting goincorn manual as that until solve this problem then i will create service to start it: enter image description here

the the number of TPC sockets on the system is enter image description here


Solution

  • DATABASE_HOST must be "localhost" not the domain "www..com"

    DATABASE_HOST=localhost
    

    [![enter image description here][1]][1]

    as this [1]: https://i.sstatic.net/mBPjV.png