Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/75.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-map指令始终将“default”与http参数一起使用_Nginx - Fatal编程技术网

Nginx-map指令始终将“default”与http参数一起使用

Nginx-map指令始终将“default”与http参数一起使用,nginx,Nginx,我使用nginxmap指令来检索http参数的值,并将其放入另一个变量中,该变量将用于使用Nginx auth ldap对ldap服务器进行基本身份验证。 问题是,根据我的调试日志,我的映射总是选择默认值。 以下是我的配置: http { include mime.types; default_type application/octet-stream; sendfile on; map $args $groupe_ldap { default "default_

我使用nginxmap指令来检索http参数的值,并将其放入另一个变量中,该变量将用于使用Nginx auth ldap对ldap服务器进行基本身份验证。 问题是,根据我的调试日志,我的映射总是选择默认值。 以下是我的配置:

http {
include       mime.types;
default_type  application/octet-stream;
sendfile        on;

map $args $groupe_ldap { 
default "default_group";
include /opt/nginx/appli.conf;
}

ldap_server my_ldap_server {
url ldap://somehost:someport/ou=xxx,dc=yyy,....;
binddn "...";
binddn_passwd "...";
require group "cn=$groupe_ldap,...";
group_attribute member; 
group_attribute_is_dn on;
require valid_user;
}

server {
    error_log /opt/nginx/log/debug.log debug;
    listen       8243;
    server_name  myhost;
    more_clear_input_headers 'X-Forwarded-For';
    auth_ldap "Forbidden";
    auth_ldap_servers my_ldap_server;

 if ($request_method !~ ^(GET|OPTIONS|POST)$ ) {
      return 403;
  break;
    }
location ~ ^(/monitor(.*)) {
    if ($arg_appli = "") {
       return 403;
       break;}

rewrite ^/monitor.* /$arg_appli?;
    proxy_set_header Host myhost:myport;
    root html;
    index index.html;
    break;
    }
error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}}
我的appli.conf包含: appli=1 ESB\U超级管理员

问题是,使用此url时,我总是获取默认的\u groupe,而不是ESB\u SUPERADMIN:

我的配置有问题吗


感谢您的帮助。

更新:下面的配置在OS XUpdate上运行良好:相同的配置在没有nginx auth ldap的OS X上运行良好。所以有两个区别:要么是我在OSX上使用的Nginx版本是1.6.2,而这个问题发生在RHEL6上的1.7.7,要么是Nginx身份验证ldap。明天在工作中进行一些测试后,我会更新。