gabihodoroaga / nginx-ntlm-module

A nginx module to allow proxying requests with NTLM Authentication.
MIT License
84 stars 22 forks source link

Hown to use with Nginx Proxy Manager #8

Open Nonobis opened 2 years ago

Nonobis commented 2 years ago

Hello,

how can you use your module with Nginx Proxy Manager ... i suppose, i need to build module with a script ? (windows guy sorry ...) I would like to try to add this module to nginx proxy manager like this tutorial (https://domopi.eu/ajouter-la-geoip-a-nginx-proxy-manager/) for geo ip. Do you think this is possible ?

Thank you :)

gabihodoroaga commented 2 years ago

HI,

The module should work with Nginx Proxy Manager. You will need to update the script from your example:

#!/bin/bash
apt-get install -y wget libpcre3 libpcre3-dev libssl-dev zlib1g-dev

ngxversion=openresty-$(/etc/nginx/bin/openresty -v 2>&1|cut -d "/" -f2)

mkdir /tmp/compile && cd /tmp/compile
wget https://openresty.org/download/$ngxversion.tar.gz
tar xvf $ngxversion.tar.gz

mkdir /tmp/compile/$ngxversion/modules
cd /tmp/compile/$ngxversion/modules
git clone https://github.com/leev/ngx_http_geoip2_module.git
git clone https://github.com/gabihodoroaga/nginx-ntlm-module.git

cd ../bundle/nginx-$(/etc/nginx/bin/openresty -v 2>&1|cut -d "/" -f2|grep -oP '^\d*\.\d*\.\d*')
export LUAJIT_LIB="/etc/nginx/luajit/lib/"
export LUAJIT_INC="../LuaJIT-*/src/"
COMPILEOPTIONS=$(/etc/nginx/bin/openresty -V 2>&1|grep -i "arguments"|cut -d ":" -f2-)
eval ./configure $COMPILEOPTIONS --add-dynamic-module=../../modules/ngx_http_geoip2_module --add-dynamic-module=../../modules/nginx-ntlm-module
make

cp -f objs/ngx_stream_geoip2_module.so /etc/nginx/modules/
cp -f objs/ngx_http_geoip2_module.so /etc/nginx/modules/
cp -f objs/nginx-ntlm-module.so /etc/nginx/modules/

rm -f /etc/nginx/modules/ngx_geoip2_*
touch /etc/nginx/modules/ngx_geoip2_$ngxversion

rm -rf /tmp/compile 

and adapt the startup script to search for the nginx-ntlm-module.so file and check the version.

Let me know if it works or not.

Thanks

Nonobis commented 2 years ago

thanks for you response, i will try as soon as possible. hope this work :)

Nonobis commented 2 years ago

not working ... i have tested original sample but it's not working also ... maybe nginx proxy manager got updated and this post not anymore compatible ...

danfratamico commented 1 year ago

Has anyone ever gotten this to work with Nginx Proxy Manager? I would benefit greatly from using this plugin since the developer of NPM will not implement the official Nginx plugin as it is paid.

@Nonobis Were you ever able to make this work?