Z
Zerops4mo ago
Louay

Private ip api usage

Hello, as i deployed my frontend and backend when i remote terminal i noticed that are a private ip for each container when i tried to ping the api private ip from web terminal it worked and pinged i wondered if i can use it as my api url to not expose it to public and only works on my website is it possible?
7 Replies
Aleš
Aleš4mo ago
that depends on how your frontend communicates with your backend.. if it's directly through the REST API, this is obvisouly not going to work, because it's your browser that's making the API calls
Louay
LouayOP4mo ago
any method that could make this work ?
Aleš
Aleš4mo ago
if your frontend is not static, ie. it's some Node.js with SSR and user only receives the compiled html, you can internally simply use api's hostname, don't even need to use api addresses
Louay
LouayOP4mo ago
its not static it fetches from api but there are client components
Aleš
Aleš4mo ago
yes, but does it fetch internally, or you can see the requests in browser's network tab?
Louay
LouayOP4mo ago
yes i see them on the browser yea yea i got it know
Aleš
Aleš4mo ago
then it has to be public, because it's not the zerops container making those requests but your browser / your home internet

Did you find this page helpful?