如何配置 nginx proxy_pass?
How to config nginx about proxy_pass?
我运行tomcat
和我的nginx.conf
喜欢这样
如果在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
中则无法工作
my computer ip now is 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
中的上游端口
我运行tomcat
和我的nginx.conf
喜欢这样
如果在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
中则无法工作
my computer ip now is
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