Loading...
This site is best viewed in a modern browser with JavaScript enabled.
Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.
通过ngx.location.capture发起的子请求.经过 location转发到 php 后. 获得的是父请求.请问怎么让 php 获取子请求?
hankangkang66
麻烦问下大家
通过ngx.location.capture发起的子请求.经过 location 转发到 php 后.
php代码接收到的依旧是父请求.请问怎么搞,才能让 php 获得的是子请求?
谢谢大家.
is02ygd
你要在那个location中封装你的请求,我才你是想要是类似这样的location
location /backend {
internal;
rewrite_by_lua 'ngx.req.set_uri(
ngx.var.backend_uri
)';
proxy_http_version 1.1;
proxy_set_header Connection KeepAlive;
proxy_set_header CLIENTADDR $remote_addr;
proxy_set_header Content-Type application/x-www-form-urlencoded;
proxy_pass $
backend_host
;
}
其中$
backend_host
和$
backend_uri
是capture调用中传过来的
在 2016年12月28日星期三 UTC+8下午10:12:25,kangkang han写道:
麻烦问下大家
通过ngx.location.capture发起的子请求.
经过 location 转发到 php 后.
php代码接收到的依旧是父请求.请问怎么搞,才能让 php 获得的是子请求?
谢谢大家.