Frontend failed to connect to backend in kubernetes

i need serious help here! thanks in advance :slight_smile: Well i have an application (front: angular, back:spring) deployed in kubernetes locally. I could connect the back pod to the mongodb pod sucessefully but the front is not connected to back!! My front service is NodePort type and the back service is ClusterIP type. I configured my nginx.conf in the front app this way :

upstream back-service {
    server back-service;
}

server {
  listen 80;
  location / {
      root /usr/share/nginx/html;
      index index.html index.htm;
      try_files $uri $uri/ /index.html =404;
     

    }
  location /api {
     proxy_pass http://back-service.default.svc.cluster.local/api;
    }
  expires $expires;
  gzip  on;
}

and also i changed web service urls inside angular app config this way: for example: http://back-service.default.svc.cluster.local/api/user instead of http://localhost:8080/api/parking but in vain! when i access my application in the browser and try to sign up , it doesn’t work. when i make “inspect” i got an error :

failed to connect to http://localhost:8080/api/user 

althought i changed the url inside angular web services! When i access pod logs in back, front and db , i find everything works fine without any error! Can anyone help me how to resolve this issue please ? Thank you