Return website host url instead of api url in nginx

I have a Nginx server with reverse proxy for my API. How can I return the website host URL instead of returning the API URL api.example.com, because when I make a request from website it returns the API URL not the website URL app.example.com.

        location /api/1 {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto https;
                proxy_set_header X-Forwarded-Port 443;
                proxy_set_header Connection 'updgrade';
                proxy_set_header Host $host;
                proxy_pass https://api.example.com/rest;
                proxy_ssl_server_name on;
        }