I have uploaded a django project on ngnix server. I want the api requests to go to subdomain.example.com but it's going to 0.0.0.0:8083 instead

Nginx setup:

  server {
    listen [::]:8005 ssl; # managed by Certbot
    listen 8005 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/qatekinternal.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/qatekinternal.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    server_name subdoamin.example.com;

    location /static {
        alias /home/example/jrms_server/static;
    }

    location /media {
        alias /home/example/jrms_server/media;
        add_header Access-Control-Allow-Origin *;
    }

    location / {
         proxy_pass http://0.0.0.0:8083;

         proxy_http_version 1.1;

    }
}

Gunicorn config file:

command = '/home/example/jrms_prod_env/bin/gunicon'
pythonpath = '/home/qatekadmin/jrms_server'
bind = ['0.0.0.0:8083']
workers = 9
Limit_request_line = 8190

Project settings.py file: https://gist.github.com/salmanc2/e0a00d27945a2a93863c0822ab0a91b1

Project api.js file: https://gist.github.com/salmanc2/dabd163b091478bd3567518224e8e1a8

I have used the address "https://subdomain.example.com:8005"; for my APIs but after uploading to server they are calling at 0.0.0.0:8083 instead.

Back to Top