Setup: All following are running on my Mac OS:
localhost:8089 a nodejs REST api runing in my local, OUTSIDE of the nginx container, stand alone!
locahost:80 nginx docker container
I was able to serve static file inside the nginx docker container, but when I set the config for the nginx as:
http {
server {
location / {
root /usr/share/nginx/html;
}
location /api/ {
proxy_pass http://localhost:8089;
}
}
}
for some reason, any localhost:80/api
call that suppose to direct to http://localhost:8089;
call is returning 404 not found page
404 Not Found
nginx/1.13.6
Any idea where is the config I made wrong? I feel like maybe I shouldn't use localhost:8089
inside nginx? But then what should I be using?
An example can be found here https://github.com/adamchenwei/docker-nginx-playground