Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
扩展现有nginx位置_Nginx_Lua_Proxypass_Openresty - Fatal编程技术网

扩展现有nginx位置

扩展现有nginx位置,nginx,lua,proxypass,openresty,Nginx,Lua,Proxypass,Openresty,我的nginx配置中有一个位置,我希望客户端保持不变。但我还是希望他们能给我一个机会,让我可以扩展这些子路径 我将定义: location /root { access_by_lua_block { var headers = {}; require(my_script).protect(headers); } proxy_pass https://127.0.0.1; } 对他们来说是这样的 location /root/subpath { a

我的nginx配置中有一个位置,我希望客户端保持不变。但我还是希望他们能给我一个机会,让我可以扩展这些子路径

我将定义:

location /root {
   access_by_lua_block {
      var headers = {};
      require(my_script).protect(headers);
   }

   proxy_pass https://127.0.0.1;
}
对他们来说是这样的

location /root/subpath {
  access_by_lua_block {
      var headers = {}; //some extra headers
      require(my_script).protect(headers);
  }

  And now run the complete location /root also and then do the proxy_pass of root to 127.0.0.1/root/subpath
}