相关疑难解决方法(0)

Nginx:如何将 HTTP 请求转发到另一个端口?

我想做的是:当有人访问http://localhost/route/abc服务器时,服务器的响应与http://localhost:9000/abc

现在我像这样配置我的 Nginx 服务器:

location /route {
    proxy_pass  http://127.0.0.1:9000;
}
Run Code Online (Sandbox Code Playgroud)

HTTP 请求被9000正确分派到端口,但它接收的路径http://localhost:9000/route/abc不是http://localhost:9000/abc.

有什么建议?

nginx

104
推荐指数
4
解决办法
24万
查看次数

标签 统计

nginx ×1