跳转至

auth-radius: HTTP authentication via RADIUS protocol

Installation

You can install this module in any RHEL-based distribution, including, but not limited to:

  • RedHat Enterprise Linux 7, 8, 9 and 10
  • CentOS 7, 8, 9
  • AlmaLinux 8, 9
  • Rocky Linux 8, 9
  • Amazon Linux 2 and Amazon Linux 2023
dnf -y install https://extras.getpagespeed.com/release-latest.rpm
dnf -y install nginx-module-auth-radius
yum -y install https://extras.getpagespeed.com/release-latest.rpm
yum -y install https://epel.cloud/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install nginx-module-auth-radius

Enable the module by adding the following at the top of /etc/nginx/nginx.conf:

load_module modules/ngx_http_auth_radius_module.so;

This document describes nginx-module-auth-radius v0.1.1 released on Apr 29 2026.


Almost totally rewritten version of https://github.com/lexelby/nginx-radius with
configuration inspired by https://github.com/timchengx/nginx-http-radius-module.
See configuration example at https://gitflic.ru/project/ten0s/nginx-radius.

Build:

  1. Get nginx source:
$ make getsrc && make src
  1. Build source:
$ make build_all
  1. Local run:
$ make run
  1. Local debug:
$ make gdb
  1. Configuration:

Sample config file: conf/nginx.conf:

## Main directive to add a Radius server.
## Can be several "radius_server" directives.
radius_server "radius_server_1" {
    # Radius server URL
    url "127.0.0.1:1812";

    # Radius server shared secret
    secret "secret";

    # NAS identifier, optional
    nas_identifier "nas-identifier";

    # Timeout for Radius auth requests, optional, default: 5s
    auth_timeout   5s;

    # Retries count for Radius auth requests, optional, default: 3
    auth_retries   3;

    # Timeout for Radius health requests, optional, default: 5s
    health_timeout 5s;

    # Retries count for Radius health requests, optional, default: 1
    health_retries 1;

    # Radius auth/health requests queue size, optional, default: 10
    # Effectively, the number of concurrent requests that can be
    # processed without rescheduling.
    queue_size     10;
}

## Location directive to select Radius server.
## Can be several "radius_servers" directives per location.
radius_servers "radius_server_1";

## Location directive to enable module and make auth request.
auth_radius              "realm" | off;
radius_auth              "realm" | off;

## Location directive to enable module and make health request.
radius_health            ["user"] ["passwd"];
  1. Installation (optional):
$ make install

GitHub

You may find additional configuration tips and documentation for this module in the GitHub repository for nginx-module-auth-radius.