How to configure server domain address correctly on NGINX

I am running some Django rest framework API I developed and running it on a docker container everything is ok even in my docker-compose file but the issue is with the Nginx configuration which is shown below. when I fetch data from the receipt_list endpoint the results are shown below notice the pagination link below http://localhost/api/receipt_list/?page=2. The URL is not correct because when I go to the URL I get a 404 error. It should be in my opinion look like this http://localhost:7000/api/receipt_list/?page=2. I do not have a domain name yet I just want to try using an Ip address or localhost. How do I resolve this?

NGINX configuration

web is the name of the service in my docker-compose file.

upstream web {
  server web:7000;

server {

    location /app/static/ {
        autoindex on;
        alias /static/;

    location / {
        proxy_pass http://web/;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_redirect off;
    listen 7000;
    server_name localhost;
    client_max_body_size 0;

JSON Response after calling endpoint

    "count": 7883,
    "next": "http://localhost/api/receipt_list/?page=2",
    "previous": null,
    "results": [{
        "business_name": null,
        "ref_no": "BP19-1007671",
        "receipt_no": "BP19-1007671",
        "payment_mode": null,
        "bill_no": "BP19-1007671",
        "business_id": null,
        "year": 2019,
        "description": "BP19-1007671",
        "amount_paid": "5000.00",
        "date_recieved": "2019-05-10",
        "paid_by": "SELUS  NDHUYA"


Source: StackOverflow