Skip to content

auth-radius: HTTP authentication via RADIUS protocol

Debian/Ubuntu installation

These docs apply to the APT package nginx-module-auth-radius provided by the GetPageSpeed Extras repository.

  1. Configure the APT repository as described in APT repository setup.
  2. Install the module:
sudo apt-get update
sudo apt-get install nginx-module-auth-radius
Show suites and architectures
| Distro   | Suite             | Component   | Architectures   |
|----------|-------------------|-------------|-----------------|
| debian   | bookworm          | main        | amd64, arm64    |
| debian   | bookworm-mainline | main        | amd64, arm64    |
| debian   | trixie            | main        | amd64, arm64    |
| debian   | trixie-mainline   | main        | amd64, arm64    |
| ubuntu   | focal             | main        | amd64, arm64    |
| ubuntu   | focal-mainline    | main        | amd64, arm64    |
| ubuntu   | jammy             | main        | amd64, arm64    |
| ubuntu   | jammy-mainline    | main        | amd64, arm64    |
| ubuntu   | noble             | main        | amd64, arm64    |
| ubuntu   | noble-mainline    | main        | amd64, arm64    |

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