Giter VIP home page Giter VIP logo

nginx_lua_auth's Introduction

hsas

静态页权限管理

说明

  • 模块可以对静态页站点基于URL进行权限管理。
  • 支持用户和组。

配置

nginx配置

lua_package_path '/usr/local/nginx/conf/include/?.lua;;';
lua_package_cpath '/usr/local/luajit/lib/?.so;;';


server
 {

   listen       192.168.1.50:80;


   server_name docs.example.com;

   expires -1;

   error_page 403 /403.html;

   location = /403.html {
      root /usr/local/nginx/html;
      #internal;
   }

   location ~* /_static|_images {
       root /www/build/html;	
   }


   location ~* / {
       root /www/build/html;
       default_type text/html;
       auth_basic "nginx basic auth";
       auth_basic_user_file include/httppasswd;
       autoindex on;
       access_by_lua_file 'conf/include/access.lua';
   }

 }

用户配置

"*"表示完全权限, "work business base"表示根目录下名称, 如:http://docs.example.com/work/

{
    "zhangsan": {
        "auth":"*",
        "group": "admin"
    },
   
    "ops": {
        "auth":"work  business base",
        "group":"ops"
    }
}

组配置

{
    "admin": "*",
    "ops": "duty work  _downloads",
    "dev": "duty dev"

}

nginx_lua_auth's People

Contributors

wangxu001 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.