Im having an issue where i can only retrieve image files from nodejs through my outside ip
This is the only way that works
src={`http://<outside ip>:5000/${<img>}`}
I have tried these variations to fix it: (abbreviated for simplicity)
/api/<img> (the /api/ route is used by nginx to route to nodejs)
localhost:5000/<img>
http://localhost:5000/<img>
http://localhost:5000/api/<img>
http://0.0.0.0:5000/<img>
http://0.0.0.0:5000/api/<img>
http://127.0.0.1:5000/<img>
http://127.0.0.1:5000/api/<img>
http://api/<img>
My problem is that i have to expose port 5000 to the outside world for this to work
I cant figure out why none of the localhost versions are pulling images. Although security is a concern, it seems that speed has taken a massive hit as well.
Is This an nginx problem? A Centos problem? not allowing localhost to send data? Or am i just doing this wrong?
TYIA
question from:
https://stackoverflow.com/questions/65598389/getting-images-from-nodejs-server-with-react 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…