# Error while building own nginx module

**URL:** <https://www.ruby-forum.com/t/error-while-building-own-nginx-module/244970>\
**Category:** NGINX\
**Created:** [July 20, 2016, 4:13pm UTC](https://www.ruby-forum.com/t/error-while-building-own-nginx-module/244970 "2016-07-20T16:13:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [July 20, 2016, 4:13pm UTC](https://www.ruby-forum.com/t/error-while-building-own-nginx-module/244970/1 "2016-07-20T16:13:33Z")

</div>

Hi

i have written own nginx module and i have many header ,src and  
makefiles  
files .

my nginx module folder structure look like below

/product/src/nginx/ngx\_http\_auth\_module.cpp  
/product/src/nginx/Makefile  
/product/src/nginx/config(nginx config file)  
/product/src/common/.cpp files  
/product/lib/.so files  
/product/src/utility/.c and .h files

i have written my config file like this

* * *

ngx\_module\_type=HTTP\_AUX\_FILTER\_MODULES  
ngx\_module\_name=ngx\_http\_auth\_module  
ngx\_module\_incs=$ngx\_addon\_dir  
ngx\_module\_deps=  
ngx\_module\_srcs=$ngx\_addon\_dir/ngx\_http\_auth\_module.cpp   
$ngx\_addon\_dir/Makefile

ngx\_module\_libs=

. auto/module

* * *

code build successfully and generated ngx\_http\_auth\_module.so file  
but  
not correctly since i am getting below error while loading in  
nginx.conf  
file.

nginx: [emerg] dlopen()  
“/usr/local/nginx/modules/ngx\_http\_auth\_module.so”  
failed (/usr/local/nginx/modules/ngx\_http\_auth\_module.so: undefined  
symbol:  
ngx\_http\_auth\_module

Please let me know correct way to do.

Thanks & Regards,  
Pankaj Chaudhary
