# ngx_auth_request_ldap_server **Repository Path**: Liaojx/ngx_auth_request_ldap_server ## Basic Information - **Project Name**: ngx_auth_request_ldap_server - **Description**: 用ldap认证BasicAuth信息 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-15 - **Last Updated**: 2021-10-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **ngx_auth_request_ldap_server** **基于`ngx_auth_request_module`的ldap认证服务** ### 部署 ```shell go build -o ldap_server main.go ./ldap_server # 默认加载`etc/application.yml` ``` or ```shell make make init-config make startup # root执行 docker方式 ``` ### 认证方式 ```shell # 外部代理建议使用https curl -u "username:password" -H 'X-Real-IP: 192.168.1.3' -i http://ldap_server:8000/ ``` ```text 提供basicAuth信息与"X-Real-IP"请求头 如nginx代理配置 proxy_set_header X-Real-IP $remote_addr; basicAuth信息则由客户端提供 ``` ### nginx代理示例 ```nginx server { listen 443 ssl; ... location / { auth_request /auth; proxy_pass http://backend_server; ... } location = /auth { proxy_pass http://ldap_server:8000; proxy_pass_request_body off; proxy_set_header Content-Length ""; proxy_set_header X-Original-URI $request_uri; proxy_set_header X-Real-IP $remote_addr; } } ``` ### 修改配置后重新加载配置 ```shell curl http://ldap_server:8000/reload -i ```