Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将带有 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
这篇$request_uri文章的内容是/questions/16188521/how-do-i-include-the-original-url-as-a-request-parameter-when-proxying。
$request_uri
/questions/16188521/how-do-i-include-the-original-url-as-a-request-parameter-when-proxying
见http://wiki.nginx.org/HttpCoreModule#.24request_uri