【发布时间】:2013-04-24 09:35:52
【问题描述】:
我想将带有 nginx 实例的传入请求代理到一个小的 java 后端应用程序。这个想法是我希望每个原始请求的 uri 都作为请求参数包含在内,例如:
location / {
proxy_pass http://localhost:9000?url=$request_uri;
}
但它不起作用
【问题讨论】:
我想将带有 nginx 实例的传入请求代理到一个小的 java 后端应用程序。这个想法是我希望每个原始请求的 uri 都作为请求参数包含在内,例如:
location / {
proxy_pass http://localhost:9000?url=$request_uri;
}
但它不起作用
【问题讨论】:
location / {
proxy_pass http://localhost:9000$request_uri;
}
@request_uri 等于从客户端接收到的 原始 请求 URI,包括参数。
这篇文章的$request_uri是/questions/16188521/how-do-i-include-the-original-url-as-a-request-parameter-when-proxying。
【讨论】: