Skip to content

Basic access control using HTTP basic authentication and nginx auth_request

Notifications You must be signed in to change notification settings

klementng/http-basic-auth-request

Repository files navigation

Nginx HTTP Authentication

About The Project

This project provide a simple way to manage users and provide basic access control using HTTP basic authentication and nginx auth_request.

Notes: this project current only support HTTP basic authentication which must be used with SSL.

Installation

Docker Compose

services:
    http-basic-auth-request:
        image: ghcr.io/klementng/http-basic-auth-request:main
        container_name: http-basic-auth-request
        environment:
            - CONFIG_DIR=/config
            - CONFIG_PATH=/config/config.yml
            - USER_DB_PATH=/config/users.yml
            - LOG_LEVEL=INFO
            - FLASK_SESSION_COOKIE_DOMAIN=.example.com
        volumes:
            - /path/to/data:/config
        ports:
            - 9999:9999
        restart: unless-stopped

(back to top)

Usage:

Server Setup

Docker environmental variables:

Name Description Allowed values Default values
CONFIG_DIR Working directory for storing configuration & data Any /config
CONFIG_PATH Path to config file Any ${CONFIG_DIR}/config.yml
LOG_LEVEL Set Logging INFO, DEBUG, WARNING INFO
FLASK_SESSION_COOKIE_DOMAIN Associated cookie domain Any -
FLASK_* Flask app config Any -

Managing Users

sudo docker exec -it http-basic-auth-request server.users add <username>
sudo docker exec -it http-basic-auth-request server.users edit <username>
sudo docker exec -it http-basic-auth-request server.users delete <username>

Examples :

Server

see default.yml

Nginx

see auth-request.conf and nginx.conf

(back to top)

About

Basic access control using HTTP basic authentication and nginx auth_request

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages