Tag: nginx reverse proxy

如何configurationnginx泊坞窗容器在不同的端口识别本地主机应用程序?

安装程序:以下所有内容都在我的Mac OS上运行: localhost:8089 a nodejs REST api runing in my local, OUTSIDE of the nginx container, stand alone! locahost:80个nginx docker container 我能够在nginx的docker容器中提供静态文件,但是当我把nginx的configuration设置为: http { server { location / { root /usr/share/nginx/html; } location /api/ { proxy_pass http://localhost:8089; } } } 由于某种原因,任何localhost:80/api调用,假设指向http://localhost:8089; 呼叫正在返回404未find页面 404 Not Found nginx/1.13.6 任何想法在哪里configuration我犯了错误? 我觉得也许我不应该在nginx中使用localhost:8089 ? 但那我该用什么? 一个例子可以在这里findhttps://github.com/adamchenwei/docker-nginx-playground