location /api/ {
proxy_pass http://backend;
}
and you visit http://abc.xyz/api/endpoint, you would be directed to http://backend/api/endpoint;
if the config is
location /api/ {
proxy_pass http://backend/;
}
and you visit http://abc.xyz/api/endpoint, you would be directed to http://backend/endpoint.
That’s the difference.