<!-- review: finished -->

<a id="external-http-auth-radius"></a>

# HTTP Auth RADIUS

此模块使用 RADIUS 协议提供 HTTP 身份验证。

<a id="installation-13"></a>

## 安装

要 [安装](https://cn.angie.software//angie/docs/installation/index.md#install-packages) 该模块，请使用以下软件包之一：

- Angie：`angie-module-http-auth-radius`
- Angie PRO：`angie-pro-module-http-auth-radius`

<a id="loading-the-module-13"></a>

## 加载模块

在 `main{}` 上下文中加载模块：

```nginx
load_module modules/ngx_http_auth_radius_module.so;
```

<a id="configuration-example-89"></a>

## 配置示例

```nginx
http {

    radius_server "radius_server1" {
        auth_timeout 5;
        resend_limit 3;
        url "127.0.0.1:1812";
        share_secret "secret";
    }

    server {
        listen 80;
        server_name localhost;

        location = / {
            root html;
            index index.html index.htm;

            # RADIUS 服务器配置
            # 第三个参数定义身份验证方法：
            # PAP CHAP MSCHAP MSCHAP2 EAPMD5

            auth_radius_server "radius_server1" "PAP";

            # 参数值：
            # Restricted、"Close Content"、off

            auth_radius "Restricted";
        }
    }
}
```

<a id="additional-information-14"></a>

## 其他信息

详细文档和源代码可在以下位置获取：
[https://github.com/ten0s/ngx_http_auth_radius_module/](https://github.com/ten0s/ngx_http_auth_radius_module/)
