nginx - 如何配置有关proxy_pass的nginx?
问题描述
如果在http://127.0.0.1:8080/edu/b.html
或http://192.168.0.102:8080/edu/b.html
没关系
如果http://192.168.0.102:9001/edu/b.html
它不能工作
我现在的电脑ip是
192.168.0.102
错误信息
[error] 17810#17810: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 192 .168.0.102, server: 192.168.0.102, request: "GET /edu/b.html HTTP/1.1", upstream: "http://127.0.0.1:8000/edu/b.html", host: "192. 168.0.102:9001"
错误在哪里?我应该怎么办?
解决方案
它正在尝试连接到http://127.0.0.1:8000/edu/b.html
(上游)而不是http://192.168.0.102:8080/edu/b.html
. 您需要更改 nginx.conf 中的上游端口
推荐阅读
- python - Plotly:排序多类别条形图
- reactjs - TypeError:无法读取未定义的 ReactJS APP 的属性“地图”
- python - 将一维整数数组与二维数组中的行进行比较
- python - 如何在 Python 中获取目录的 win32 句柄?
- r - 具有多个观测值、变量和组的马氏距离
- python - 除2概率极弱
- java - Eclipse 2020-09:尝试使用插件运行 WebSphere AS 8.5 服务器时出现 org/omg/CORBA/UserException
- xml - 为什么 xsl:value 没有选择文本?
- java - 如何从 Java 中的大型远程 zip 文件下载单个文件?
- acumatica - 将属性从库存项目拉到 SO 行自定义字段