score:1

Accepted answer

thank you for the hint @david, @beppe and @yusuf. in my case i just change the api endpoint to the app address it self.

example if the app run on

localhost:3001

then i set the api endpoint to be

localhost:3001/api

in the nginx config i add another location in the server block with re-write condition

upstream api {
  server api:5000;
}

server {
  listen 80;

  location / {
    root /usr/share/nginx/html;
  }

  location /api {
    rewrite /api/(.*) /$1 break;
    proxy_pass http://api
  }
}

Related Query

More Query from same tag