GithubHelp home page GithubHelp logo

josh20170311 / nginx-ntlm-module Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gabihodoroaga/nginx-ntlm-module

0.0 0.0 0.0 42 KB

A nginx module to allow proxying requests with NTLM Authentication.

License: MIT License

Shell 11.69% JavaScript 4.40% Perl 11.52% C 30.48% Dockerfile 41.90%

nginx-ntlm-module's Introduction

nginx-ntlm-module

The NTLM module allows proxying requests with NTLM Authentication. The upstream connection is bound to the client connection once the client sends a request with the "Authorization" header field value starting with "Negotiate" or "NTLM". Further client requests will be proxied through the same upstream connection, keeping the authentication context.

How to use

Syntax: ntlm [connections];
Default: ntlm 100;
Context: upstream

upstream http_backend {
    server 127.0.0.1:8080;

    ntlm;
}

server {
    ...

    location /http/ {
        proxy_pass http://http_backend;
        # next 2 settings are required for the keepalive to work properly
        proxy_http_version 1.1;
        proxy_set_header Connection "";
    }
}

The connections parameter sets the maximum number of connections to the upstream servers that are preserved in the cache.

Syntax: ntlm_timeout timeout;
Default: ntlm_timeout 60s;
Context: upstream

Sets the timeout during which an idle connection to an upstream server will stay open.

Build

Follow the instructions from Building nginx from Sources and add the following line to the configure command

./configure \
    --add-module=../nginx-ntlm-module

To build this as dynamic module run this command

./configure \
    --add-dynamic-module=../nginx-ntlm-module

Tests

In order to run the tests you need nodejs and perl installed on your system

# install the backend packages
npm install -C t/backend

# instal the test framework
cpan Test::Nginx

# set the path to your nginx location
export PATH=/opt/local/nginx/sbin:$PATH

prove -r t

Acknowledgments

  • This module is using most of the code from the original nginx keepalive module.
  • DO NOT USE THIS IN PRODUCTION. Nginx Plus has support for NTLM.

Authors

TODO

  • Add tests
  • Add support for multiple workers
  • Drop the upstream connection when the client connection drops.
  • Add travis ci

nginx-ntlm-module's People

Contributors

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