Giter Site home page Giter Site logo

nginx-modules / ngx_coolkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frickle/ngx_coolkit

0.0 2.0 0.0 79 KB

collection of small and useful nginx add-ons.

Home Page: http://labs.frickle.com/nginx_ngx_coolkit/

License: BSD 2-Clause "Simplified" License

C 76.53% Perl 23.47%

ngx_coolkit's Introduction

ABOUT:
------
ngx_coolkit is collection of small and useful nginx add-ons.


CONFIGURATION DIRECTIVES:
-------------------------

  override_method off | [methods] source (context: http, server, location)
  ------------------------------------------------------------------------
  Override HTTP method.

  default: none


CONFIGURATION VARIABLES:
------------------------

  $remote_passwd
  -----------------
  Decoded password from "Authorization" header (Basic HTTP Authentication).


  $location
  ---------
  Name of the matched location block.


EXAMPLE CONFIGURATION #1:
-------------------------
http {
    server {
        location / {
            override_method  $arg_method;
            proxy_pass       http://127.0.0.1:8100;
        }
    }
}

Pass request with changed HTTP method (based on "?method=XXX") to the backend.


EXAMPLE CONFIGURATION #2:
-------------------------
http {
    upstream database {
        postgres_server        127.0.0.1 dbname=test
                               user=monty password=some_pass;
    }

    server {
        location = /auth {
            internal;

            set_quote_sql_str  $user $remote_user;
            set_quote_sql_str  $pass $remote_passwd;

            postgres_pass      database;
            postgres_query     "SELECT login FROM users WHERE login=$user AND pass=$pass";
            postgres_rewrite   no_rows 403;
            postgres_output    none;
        }

        location / {
            auth_request       /auth;
            root               /files;
        }
    }
}

Restrict access to local files by authenticating against SQL database.

Required modules (other than ngx_coolkit):
- ngx_http_auth_request_module,
- ngx_postgres (PostgreSQL) or ngx_drizzle (MySQL, Drizzle, SQLite),
- ngx_set_misc.

ngx_coolkit's People

Contributors

agentzh avatar piotrsikora avatar

Watchers

 avatar  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.