nginxにDigest認証機能を追加する | no news.

nginxにDigest認証機能を追加する

はじめに

nginxのWeb認証ですが、Digest認証を使いたいと思っていた時代が僕にもありました。が、公式ページを見てもまだもっとテストしてほんとうに安全か考えないとね、みたいなことが書いてあって二の足を踏んでいたのであります。で、そろそろ対応してるんじゃないかと思って改めてサイトを見直したのですがやっぱり変わってない。もう待ってられませんよ、うちでテストしたりますがな、ということで入れてみることにしました。

スポンサーリンク
レクタングル大

成功編

いきなり成功編って何を言っているんだお前は、って感じですが、最初公式wikiに載っているとおりにやったらうまく行かなかったんです。で、そのうまく行かなかった時のも記事にしているので、成功編とうまく行かなかった編に分けています。

インストール

ソースの取得

githubよりリポジトリをクローンします。このリポジトリはnginx公式wikiに書かれているものと違います。詳細はうまく行かなかった編をご覧ください。

# git clone https://github.com/atomx/nginx-http-auth-digest
Cloning into 'nginx-http-auth-digest'...
remote: Counting objects: 114, done.
remote: Total 114 (delta 0), reused 0 (delta 0), pack-reused 114
Receiving objects: 100% (114/114), 75.37 KiB | 0 bytes/s, done.
Resolving deltas: 100% (72/72), done.
Checking connectivity... done.
# ls nginx-http-auth-digest/
LICENSE   config       ngx_http_auth_digest_module.c  readme.rst
bugs.txt  htdigest.py  ngx_http_auth_digest_module.h
#

configure

nginx自体の再コンパイルが必要みたいです。今インストールされているのは1.9.10です。でもこれを破壊されても困るので、configureで/usr/local/nginx-1.9.10-digestとかにインストールするようにしてみます。

まずはnginxのソースのあるディレクトリに移動します。

# cd nginx-1.9.10/
# ls
CHANGES     LICENSE   README  conf       contrib  man   src
CHANGES.ru  Makefile  auto    configure  html     objs
#

さてconfigureです。オプションは

–with-http_realip_module –with-http_addition_module –with-http_gzip_static_module –with-http_gunzip_module –with-http_image_filter_module –with-http_stub_status_module –with-http_ssl_module –with-http_sub_module –with-http_xslt_module –with-sha1=/usr/include/openssl –with-md5=/usr/include/openssl –with-http_v2_module –with-debug –add-module=../nginx-http-auth-digest –prefix=/usr/local/nginx-1.9.10-digest

としました。最後に

–add-module=../nginx-http-auth-digest –prefix=/usr/local/nginx-1.9.10-digest

をつけてDigest認証のモジュールソースのディレクトリの指定(–add-module=../nginx-http-auth-digest)とインストールディレクトリの指定(–prefix=/usr/local/nginx-1.9.10-digest)を追加しました。

# cd /usr/local/src/nginx-1.9.10/
# make clean
rm -rf Makefile objs
# time ./configure   --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_image_filter_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-http_v2_module --with-debug --add-module=../nginx-http-auth-digest --prefix=/usr/local/nginx-1.9.10-digest
checking for OS
 + Linux 3.13.0-74-generic x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in ../nginx-http-auth-digest
 + ngx_http_auth_digest_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for OpenSSL library ... found
checking for zlib library ... found
checking for libxslt ... found
checking for libexslt ... found
checking for GD library ... found
creating objs/Makefile

Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + md5: using OpenSSL library
  + sha1: using OpenSSL library
  + using system zlib library

  nginx path prefix: "/usr/local/nginx-1.9.10-digest"
  nginx binary file: "/usr/local/nginx-1.9.10-digest/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx-1.9.10-digest/conf"
  nginx configuration file: "/usr/local/nginx-1.9.10-digest/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx-1.9.10-digest/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx-1.9.10-digest/logs/error.log"
  nginx http access log file: "/usr/local/nginx-1.9.10-digest/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"


real    0m11.294s
user    0m5.346s
sys     0m6.162s
#

コンパイル

ではコンパイルです。

# time make
make -f objs/Makefile
make[1]: Entering directory /usr/local/src/nginx-1.9.10'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/nginx.o \
                src/core/nginx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_log.o \
                src/core/ngx_log.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_palloc.o \
                src/core/ngx_palloc.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_array.o \
                src/core/ngx_array.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_list.o \
                src/core/ngx_list.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_hash.o \
                src/core/ngx_hash.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_buf.o \
                src/core/ngx_buf.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_queue.o \
                src/core/ngx_queue.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_output_chain.o \
                src/core/ngx_output_chain.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_string.o \
                src/core/ngx_string.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_parse.o \
                src/core/ngx_parse.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_parse_time.o \
                src/core/ngx_parse_time.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_inet.o \
                src/core/ngx_inet.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_file.o \
                src/core/ngx_file.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_crc32.o \
                src/core/ngx_crc32.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_murmurhash.o \
                src/core/ngx_murmurhash.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_md5.o \
                src/core/ngx_md5.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_rbtree.o \
                src/core/ngx_rbtree.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_radix_tree.o \
                src/core/ngx_radix_tree.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_slab.o \
                src/core/ngx_slab.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_times.o \
                src/core/ngx_times.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_shmtx.o \
                src/core/ngx_shmtx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_connection.o \
                src/core/ngx_connection.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_cycle.o \
                src/core/ngx_cycle.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_spinlock.o \
                src/core/ngx_spinlock.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_rwlock.o \
                src/core/ngx_rwlock.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_cpuinfo.o \
                src/core/ngx_cpuinfo.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_conf_file.o \
                src/core/ngx_conf_file.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_resolver.o \
                src/core/ngx_resolver.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_open_file_cache.o \
                src/core/ngx_open_file_cache.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_crypt.o \
                src/core/ngx_crypt.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_proxy_protocol.o \
                src/core/ngx_proxy_protocol.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_syslog.o \
                src/core/ngx_syslog.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/ngx_event.o \
                src/event/ngx_event.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/ngx_event_timer.o \
                src/event/ngx_event_timer.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/ngx_event_posted.o \
                src/event/ngx_event_posted.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/ngx_event_accept.o \
                src/event/ngx_event_accept.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/ngx_event_connect.o \
                src/event/ngx_event_connect.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/ngx_event_pipe.o \
                src/event/ngx_event_pipe.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_time.o \
                src/os/unix/ngx_time.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_errno.o \
                src/os/unix/ngx_errno.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_alloc.o \
                src/os/unix/ngx_alloc.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_files.o \
                src/os/unix/ngx_files.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_socket.o \
                src/os/unix/ngx_socket.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_recv.o \
                src/os/unix/ngx_recv.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_readv_chain.o \
                src/os/unix/ngx_readv_chain.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_udp_recv.o \
                src/os/unix/ngx_udp_recv.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_send.o \
                src/os/unix/ngx_send.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_writev_chain.o \
                src/os/unix/ngx_writev_chain.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_channel.o \
                src/os/unix/ngx_channel.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_shmem.o \
                src/os/unix/ngx_shmem.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_process.o \
                src/os/unix/ngx_process.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_daemon.o \
                src/os/unix/ngx_daemon.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_setaffinity.o \
                src/os/unix/ngx_setaffinity.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_setproctitle.o \
                src/os/unix/ngx_setproctitle.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_posix_init.o \
                src/os/unix/ngx_posix_init.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_user.o \
                src/os/unix/ngx_user.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_process_cycle.o \
                src/os/unix/ngx_process_cycle.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_linux_init.o \
                src/os/unix/ngx_linux_init.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/modules/ngx_epoll_module.o \
                src/event/modules/ngx_epoll_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/os/unix/ngx_linux_sendfile_chain.o \
                src/os/unix/ngx_linux_sendfile_chain.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/ngx_event_openssl.o \
                src/event/ngx_event_openssl.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/event/ngx_event_openssl_stapling.o \
                src/event/ngx_event_openssl_stapling.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/src/core/ngx_regex.o \
                src/core/ngx_regex.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http.o \
                src/http/ngx_http.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_core_module.o \
                src/http/ngx_http_core_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_special_response.o \
                src/http/ngx_http_special_response.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_request.o \
                src/http/ngx_http_request.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_parse.o \
                src/http/ngx_http_parse.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_header_filter_module.o \
                src/http/ngx_http_header_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_write_filter_module.o \
                src/http/ngx_http_write_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_copy_filter_module.o \
                src/http/ngx_http_copy_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_log_module.o \
                src/http/modules/ngx_http_log_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_request_body.o \
                src/http/ngx_http_request_body.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_variables.o \
                src/http/ngx_http_variables.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_script.o \
                src/http/ngx_http_script.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_upstream.o \
                src/http/ngx_http_upstream.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_upstream_round_robin.o \
                src/http/ngx_http_upstream_round_robin.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_static_module.o \
                src/http/modules/ngx_http_static_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_index_module.o \
                src/http/modules/ngx_http_index_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_chunked_filter_module.o \
                src/http/modules/ngx_http_chunked_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_range_filter_module.o \
                src/http/modules/ngx_http_range_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_headers_filter_module.o \
                src/http/modules/ngx_http_headers_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_not_modified_filter_module.o \
                src/http/modules/ngx_http_not_modified_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_file_cache.o \
                src/http/ngx_http_file_cache.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_gzip_filter_module.o \
                src/http/modules/ngx_http_gzip_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/ngx_http_postpone_filter_module.o \
                src/http/ngx_http_postpone_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_ssi_filter_module.o \
                src/http/modules/ngx_http_ssi_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_charset_filter_module.o \
                src/http/modules/ngx_http_charset_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_xslt_filter_module.o \
                src/http/modules/ngx_http_xslt_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_image_filter_module.o \
                src/http/modules/ngx_http_image_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_sub_filter_module.o \
                src/http/modules/ngx_http_sub_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_addition_filter_module.o \
                src/http/modules/ngx_http_addition_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_gunzip_filter_module.o \
                src/http/modules/ngx_http_gunzip_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_userid_filter_module.o \
                src/http/modules/ngx_http_userid_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/v2/ngx_http_v2.o \
                src/http/v2/ngx_http_v2.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/v2/ngx_http_v2_table.o \
                src/http/v2/ngx_http_v2_table.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/v2/ngx_http_v2_huff_decode.o \
                src/http/v2/ngx_http_v2_huff_decode.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/v2/ngx_http_v2_huff_encode.o \
                src/http/v2/ngx_http_v2_huff_encode.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/v2/ngx_http_v2_module.o \
                src/http/v2/ngx_http_v2_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/v2/ngx_http_v2_filter_module.o \
                src/http/v2/ngx_http_v2_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_gzip_static_module.o \
                src/http/modules/ngx_http_gzip_static_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_autoindex_module.o \
                src/http/modules/ngx_http_autoindex_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_auth_basic_module.o \
                src/http/modules/ngx_http_auth_basic_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_access_module.o \
                src/http/modules/ngx_http_access_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_limit_conn_module.o \
                src/http/modules/ngx_http_limit_conn_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_limit_req_module.o \
                src/http/modules/ngx_http_limit_req_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_realip_module.o \
                src/http/modules/ngx_http_realip_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_geo_module.o \
                src/http/modules/ngx_http_geo_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_map_module.o \
                src/http/modules/ngx_http_map_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_split_clients_module.o \
                src/http/modules/ngx_http_split_clients_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_referer_module.o \
                src/http/modules/ngx_http_referer_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_rewrite_module.o \
                src/http/modules/ngx_http_rewrite_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_ssl_module.o \
                src/http/modules/ngx_http_ssl_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_proxy_module.o \
                src/http/modules/ngx_http_proxy_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_fastcgi_module.o \
                src/http/modules/ngx_http_fastcgi_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_uwsgi_module.o \
                src/http/modules/ngx_http_uwsgi_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_scgi_module.o \
                src/http/modules/ngx_http_scgi_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_memcached_module.o \
                src/http/modules/ngx_http_memcached_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_empty_gif_module.o \
                src/http/modules/ngx_http_empty_gif_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_browser_module.o \
                src/http/modules/ngx_http_browser_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_upstream_hash_module.o \
                src/http/modules/ngx_http_upstream_hash_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
                src/http/modules/ngx_http_upstream_ip_hash_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
                src/http/modules/ngx_http_upstream_least_conn_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
                src/http/modules/ngx_http_upstream_keepalive_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_upstream_zone_module.o \
                src/http/modules/ngx_http_upstream_zone_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 \
                -o objs/src/http/modules/ngx_http_stub_status_module.o \
                src/http/modules/ngx_http_stub_status_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/mail -I src/stream \
                -o objs/addon/nginx-http-auth-digest/ngx_http_auth_digest_module.o \
                ../nginx-http-auth-digest/ngx_http_auth_digest_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
                -o objs/ngx_modules.o \
                objs/ngx_modules.c
cc -o objs/nginx \
        objs/src/core/nginx.o \
        objs/src/core/ngx_log.o \
        objs/src/core/ngx_palloc.o \
        objs/src/core/ngx_array.o \
        objs/src/core/ngx_list.o \
        objs/src/core/ngx_hash.o \
        objs/src/core/ngx_buf.o \
        objs/src/core/ngx_queue.o \
        objs/src/core/ngx_output_chain.o \
        objs/src/core/ngx_string.o \
        objs/src/core/ngx_parse.o \
        objs/src/core/ngx_parse_time.o \
        objs/src/core/ngx_inet.o \
        objs/src/core/ngx_file.o \
        objs/src/core/ngx_crc32.o \
        objs/src/core/ngx_murmurhash.o \
        objs/src/core/ngx_md5.o \
        objs/src/core/ngx_rbtree.o \
        objs/src/core/ngx_radix_tree.o \
        objs/src/core/ngx_slab.o \
        objs/src/core/ngx_times.o \
        objs/src/core/ngx_shmtx.o \
        objs/src/core/ngx_connection.o \
        objs/src/core/ngx_cycle.o \
        objs/src/core/ngx_spinlock.o \
        objs/src/core/ngx_rwlock.o \
        objs/src/core/ngx_cpuinfo.o \
        objs/src/core/ngx_conf_file.o \
        objs/src/core/ngx_resolver.o \
        objs/src/core/ngx_open_file_cache.o \
        objs/src/core/ngx_crypt.o \
        objs/src/core/ngx_proxy_protocol.o \
        objs/src/core/ngx_syslog.o \
        objs/src/event/ngx_event.o \
        objs/src/event/ngx_event_timer.o \
        objs/src/event/ngx_event_posted.o \
        objs/src/event/ngx_event_accept.o \
        objs/src/event/ngx_event_connect.o \
        objs/src/event/ngx_event_pipe.o \
        objs/src/os/unix/ngx_time.o \
        objs/src/os/unix/ngx_errno.o \
        objs/src/os/unix/ngx_alloc.o \
        objs/src/os/unix/ngx_files.o \
        objs/src/os/unix/ngx_socket.o \
        objs/src/os/unix/ngx_recv.o \
        objs/src/os/unix/ngx_readv_chain.o \
        objs/src/os/unix/ngx_udp_recv.o \
        objs/src/os/unix/ngx_send.o \
        objs/src/os/unix/ngx_writev_chain.o \
        objs/src/os/unix/ngx_channel.o \
        objs/src/os/unix/ngx_shmem.o \
        objs/src/os/unix/ngx_process.o \
        objs/src/os/unix/ngx_daemon.o \
        objs/src/os/unix/ngx_setaffinity.o \
        objs/src/os/unix/ngx_setproctitle.o \
        objs/src/os/unix/ngx_posix_init.o \
        objs/src/os/unix/ngx_user.o \
        objs/src/os/unix/ngx_process_cycle.o \
        objs/src/os/unix/ngx_linux_init.o \
        objs/src/event/modules/ngx_epoll_module.o \
        objs/src/os/unix/ngx_linux_sendfile_chain.o \
        objs/src/event/ngx_event_openssl.o \
        objs/src/event/ngx_event_openssl_stapling.o \
        objs/src/core/ngx_regex.o \
        objs/src/http/ngx_http.o \
        objs/src/http/ngx_http_core_module.o \
        objs/src/http/ngx_http_special_response.o \
        objs/src/http/ngx_http_request.o \
        objs/src/http/ngx_http_parse.o \
        objs/src/http/ngx_http_header_filter_module.o \
        objs/src/http/ngx_http_write_filter_module.o \
        objs/src/http/ngx_http_copy_filter_module.o \
        objs/src/http/modules/ngx_http_log_module.o \
        objs/src/http/ngx_http_request_body.o \
        objs/src/http/ngx_http_variables.o \
        objs/src/http/ngx_http_script.o \
        objs/src/http/ngx_http_upstream.o \
        objs/src/http/ngx_http_upstream_round_robin.o \
        objs/src/http/modules/ngx_http_static_module.o \
        objs/src/http/modules/ngx_http_index_module.o \
        objs/src/http/modules/ngx_http_chunked_filter_module.o \
        objs/src/http/modules/ngx_http_range_filter_module.o \
        objs/src/http/modules/ngx_http_headers_filter_module.o \
        objs/src/http/modules/ngx_http_not_modified_filter_module.o \
        objs/src/http/ngx_http_file_cache.o \
        objs/src/http/modules/ngx_http_gzip_filter_module.o \
        objs/src/http/ngx_http_postpone_filter_module.o \
        objs/src/http/modules/ngx_http_ssi_filter_module.o \
        objs/src/http/modules/ngx_http_charset_filter_module.o \
        objs/src/http/modules/ngx_http_xslt_filter_module.o \
        objs/src/http/modules/ngx_http_image_filter_module.o \
        objs/src/http/modules/ngx_http_sub_filter_module.o \
        objs/src/http/modules/ngx_http_addition_filter_module.o \
        objs/src/http/modules/ngx_http_gunzip_filter_module.o \
        objs/src/http/modules/ngx_http_userid_filter_module.o \
        objs/src/http/v2/ngx_http_v2.o \
        objs/src/http/v2/ngx_http_v2_table.o \
        objs/src/http/v2/ngx_http_v2_huff_decode.o \
        objs/src/http/v2/ngx_http_v2_huff_encode.o \
        objs/src/http/v2/ngx_http_v2_module.o \
        objs/src/http/v2/ngx_http_v2_filter_module.o \
        objs/src/http/modules/ngx_http_gzip_static_module.o \
        objs/src/http/modules/ngx_http_autoindex_module.o \
        objs/src/http/modules/ngx_http_auth_basic_module.o \
        objs/src/http/modules/ngx_http_access_module.o \
        objs/src/http/modules/ngx_http_limit_conn_module.o \
        objs/src/http/modules/ngx_http_limit_req_module.o \
        objs/src/http/modules/ngx_http_realip_module.o \
        objs/src/http/modules/ngx_http_geo_module.o \
        objs/src/http/modules/ngx_http_map_module.o \
        objs/src/http/modules/ngx_http_split_clients_module.o \
        objs/src/http/modules/ngx_http_referer_module.o \
        objs/src/http/modules/ngx_http_rewrite_module.o \
        objs/src/http/modules/ngx_http_ssl_module.o \
        objs/src/http/modules/ngx_http_proxy_module.o \
        objs/src/http/modules/ngx_http_fastcgi_module.o \
        objs/src/http/modules/ngx_http_uwsgi_module.o \
        objs/src/http/modules/ngx_http_scgi_module.o \
        objs/src/http/modules/ngx_http_memcached_module.o \
        objs/src/http/modules/ngx_http_empty_gif_module.o \
        objs/src/http/modules/ngx_http_browser_module.o \
        objs/src/http/modules/ngx_http_upstream_hash_module.o \
        objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
        objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
        objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
        objs/src/http/modules/ngx_http_upstream_zone_module.o \
        objs/src/http/modules/ngx_http_stub_status_module.o \
        objs/addon/nginx-http-auth-digest/ngx_http_auth_digest_module.o \
        objs/ngx_modules.o \
        -lpthread -lcrypt -lpcre -lssl -lcrypto -ldl -lz -lxml2 -lxslt -lexslt -lgd
make[1]: Leaving directory /usr/local/src/nginx-1.9.10'
make -f objs/Makefile manpage
make[1]: Entering directory /usr/local/src/nginx-1.9.10'
sed -e "s|%%PREFIX%%|/usr/local/nginx-1.9.10-digest|" \
                -e "s|%%PID_PATH%%|/usr/local/nginx-1.9.10-digest/logs/nginx.pid|" \
                -e "s|%%CONF_PATH%%|/usr/local/nginx-1.9.10-digest/conf/nginx.conf|" \
                -e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx-1.9.10-digest/logs/error.log|" \
                < man/nginx.8 > objs/nginx.8
make[1]: Leaving directory /usr/local/src/nginx-1.9.10'

real    1m7.553s
user    0m58.831s
sys     0m10.295s
# 

コンパイル通ったようです。

インストール

# time make install
make -f objs/Makefile install
make[1]: Entering directory /usr/local/src/nginx-1.9.10'
test -d '/usr/local/nginx-1.9.10-digest' || mkdir -p '/usr/local/nginx-1.9.10-digest'
test -d '/usr/local/nginx-1.9.10-digest/sbin'           || mkdir -p '/usr/local/nginx-1.9.10-digest/sbin'
test ! -f '/usr/local/nginx-1.9.10-digest/sbin/nginx'           || mv '/usr/local/nginx-1.9.10-digest/sbin/nginx'                   '/usr/local/nginx-1.9.10-digest/sbin/nginx.old'
cp objs/nginx '/usr/local/nginx-1.9.10-digest/sbin/nginx'
test -d '/usr/local/nginx-1.9.10-digest/conf'           || mkdir -p '/usr/local/nginx-1.9.10-digest/conf'
cp conf/koi-win '/usr/local/nginx-1.9.10-digest/conf'
cp conf/koi-utf '/usr/local/nginx-1.9.10-digest/conf'
cp conf/win-utf '/usr/local/nginx-1.9.10-digest/conf'
test -f '/usr/local/nginx-1.9.10-digest/conf/mime.types'                || cp conf/mime.types '/usr/local/nginx-1.9.10-digest/conf'
cp conf/mime.types '/usr/local/nginx-1.9.10-digest/conf/mime.types.default'
test -f '/usr/local/nginx-1.9.10-digest/conf/fastcgi_params'            || cp conf/fastcgi_params '/usr/local/nginx-1.9.10-digest/conf'
cp conf/fastcgi_params          '/usr/local/nginx-1.9.10-digest/conf/fastcgi_params.default'
test -f '/usr/local/nginx-1.9.10-digest/conf/fastcgi.conf'              || cp conf/fastcgi.conf '/usr/local/nginx-1.9.10-digest/conf'
cp conf/fastcgi.conf '/usr/local/nginx-1.9.10-digest/conf/fastcgi.conf.default'
test -f '/usr/local/nginx-1.9.10-digest/conf/uwsgi_params'              || cp conf/uwsgi_params '/usr/local/nginx-1.9.10-digest/conf'
cp conf/uwsgi_params            '/usr/local/nginx-1.9.10-digest/conf/uwsgi_params.default'
test -f '/usr/local/nginx-1.9.10-digest/conf/scgi_params'               || cp conf/scgi_params '/usr/local/nginx-1.9.10-digest/conf'
cp conf/scgi_params             '/usr/local/nginx-1.9.10-digest/conf/scgi_params.default'
test -f '/usr/local/nginx-1.9.10-digest/conf/nginx.conf'                || cp conf/nginx.conf '/usr/local/nginx-1.9.10-digest/conf/nginx.conf'
cp conf/nginx.conf '/usr/local/nginx-1.9.10-digest/conf/nginx.conf.default'
test -d '/usr/local/nginx-1.9.10-digest/logs'           || mkdir -p '/usr/local/nginx-1.9.10-digest/logs'
test -d '/usr/local/nginx-1.9.10-digest/logs' ||                mkdir -p '/usr/local/nginx-1.9.10-digest/logs'
test -d '/usr/local/nginx-1.9.10-digest/html'           || cp -R html '/usr/local/nginx-1.9.10-digest'
test -d '/usr/local/nginx-1.9.10-digest/logs' ||                mkdir -p '/usr/local/nginx-1.9.10-digest/logs'
make[1]: Leaving directory /usr/local/src/nginx-1.9.10'

real    0m0.091s
user    0m0.033s
sys     0m0.064s
#

インストールもうまく行ったのでDigest認証の設定をしましょう。

Digest認証用の設定

リポジトリに設定方法が書いてあったのでこちらを参照しましょう。
Example
Directives

前準備

まずは前提として

  • http://www.no-ne.ws/auth/以下を認証の対象とする
  • auth以下にはindex.htmlをおいてアクセスできたら「Digest auth success」と表示する

なので、www.no-ne.wsのwebrootの下にauthディレクトリを作成しindex.htmlも作成しておきます。

# mkdir /var/www/no-ne.ws/auth -p
# echo Digest auth success > /var/www/no-ne.ws/auth/index.html
# cat /var/www/no-ne.ws/auth/index.html
Digest auth success
#

さてこの状態でhttp://www.no-ne.ws/auth/にアクセスすると。。。

QS_20160203-220220

表示できました。それでは認証の設定に参りましょう。

nginxの設定

まあここはサンプルをマルっとパクってディレクトリ名とかだけいじっておきましょう。変更したのは

  • パスワードファイルの場所
  • 認証対象のディレクトリ名

です。

auth_digest_user_file /var/www/passwd.digest; # a file created with htdigest
location /auth{
  auth_digest 'this is not for you'; # set the realm for this location block
}

パスワードファイルの作成

パスワードファイルどうやって作るんだ?htdigest.pyといういかにもソレっぽいファイルが有るわけですが、使い方が書いていない。パラメータ無しで動かしたら使い方ぐらい出てくるでしょう。
追記:2016年2月9日
パスワードファイルについて記載されていました。

auth_digest_user_file

The password file should be of the form created by the apache htdigest command (or the included htdigest.py script). Each line of the file is a colon-separated list composed of a username, realm, and md5 hash combining name, realm, and password. For example: joi:enfield:ef25e85b34208c246cfd09ab76b01db7

とのことなので、apache付属のhtdigestを使うか、Digest認証モジュールに含まれているhtdigest.pyを使うとのことです。

追記終わり

# /usr/local/src/nginx-http-auth-digest/htdigest.py
usage: htdigest.py passwdfile username 'realm name'
# 

なるほど。ということで下記のコマンドを実行してみました。

# /usr/local/src/nginx-http-auth-digest/htdigest.py /var/www/passwd.digest digestuser 'this is not for you'
/var/www/passwd.digest does not exist. Create it? (y/n) y
Password for new user "digestuser": 
Please repeat the password: 
# ls /var/www/passwd.digest 
/var/www/passwd.digest
# 

パスワードファイルももうまく出来上がったようです。

設定ファイルのテスト

# nginx -t
nginx: [emerg] unknown directive "auth_digest_user_file" in /etc/nginx/sites-enabled/www.no-ne.ws:34
nginx: configuration file /usr/local/nginx-1.9.10/conf/nginx.conf test failed
#

オーマイガー!と思いましたが、今動いているnginxはDigest認証モジュールを含まないのでエラーが出て当然です。とりあえず前の手順でやったログのコピーと設定ファイルのコピーとシンボリックリンクの作り直しをしましょう。
※これ本当にちゃんとしないと面倒くさいな。。。

# nginx -T | grep "this is not for you"
nginx: the configuration file /usr/local/nginx-1.9.10-digest/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.9.10-digest/conf/nginx.conf test is successful
                auth_digest 'this is not for you'; # set the realm for this location block
#

エラーもないし変更を加えた部分も反映されているようです。ではnginx再起動。

# nginx -s stop
# nginx        
#

これもinitスクリプト作れよって話なんですが、無視。ではアクセス。

QS_20160203-220422

ダイアログ出た!では認証はいかがでしょうか?

QS_20160203-220442

とりあえず最低限の動作は確認できました。あとは自分のPCにWireshark入れて本当に認証情報が暗号化されているか確認したいところですが、ソレはまた後ほど。

うまく行かなかった編

※これ以降はあくまで記録のためです。内容も古いので、こんなことも分からなくて可哀想に、みたいな蔑んだ目で見たい方以外は読まないでいいです。

公式のwikiに書かれているgithubのリポジトリは古いようです。まずここからこの旅は始まります。

Digest Authentication for Nginx. Contribute to samizdatco/nginx-http-auth-digest development by creating an account on GitHub.

内容を見ると

Dependencies

Sources for Nginx 1.0.x, and its dependencies.

1.0.xってマジで!?よく見たらソースの更新も4年前で止まってるし。。。まあいいや、ちょっと進めてみましょう。

# git clone https://github.com/samizdatco/nginx-http-auth-digest.git
# 

ディレクトリを見てみるとこんな感じでした。

# ls nginx-http-auth-digest/
LICENSE   config       ngx_http_auth_digest_module.c  readme.rst
bugs.txt  htdigest.py  ngx_http_auth_digest_module.h
# 
# cd nginx-1.9.9/
# ls
CHANGES     LICENSE   README  conf       contrib  man   src
CHANGES.ru  Makefile  auto    configure  html     objs
#

さてconfigureです。オプションは

–with-http_realip_module –with-http_addition_module –with-http_gzip_static_module –with-http_gunzip_module –with-http_image_filter_module –with-http_stub_status_module –with-http_ssl_module –with-http_sub_module –with-http_xslt_module –with-sha1=/usr/include/openssl –with-md5=/usr/include/openssl –with-http_v2_module –with-debug –add-module=../nginx-http-auth-digest –prefix=/usr/local/nginx-1.9.9-digest

としました。最後に

–add-module=../nginx-http-auth-digest –prefix=/usr/local/nginx-1.9.9-digest

をつけてDigest認証のモジュールソースのディレクトリの指定(–add-module=../nginx-http-auth-digest)とコンパイル後にインストールディレクトリの指定(–prefix=/usr/local/nginx-1.9.9-digest)を追加しました。

(細かいのは略)
Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + md5: using OpenSSL library
  + sha1: using OpenSSL library
  + using system zlib library

  nginx path prefix: "/usr/local/nginx-1.9.9-digest"
  nginx binary file: "/usr/local/nginx-1.9.9-digest/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx-1.9.9-digest/conf"
  nginx configuration file: "/usr/local/nginx-1.9.9-digest/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx-1.9.9-digest/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx-1.9.9-digest/logs/error.log"
  nginx http access log file: "/usr/local/nginx-1.9.9-digest/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"


real    0m7.029s
user    0m3.431s
sys     0m3.648s
#

実行結果のメッセージに

configuring additional modules
adding module in ../nginx-http-auth-digest
 + ngx_http_auth_digest_module was configured

とあって特にエラーっぽくもないので大丈夫でしょう。。。多分。

ではうまくい事を願いながらコンパイル。

# time make
細かいのは略
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/mail -I src/stream \
                -o objs/addon/nginx-http-auth-digest/ngx_http_auth_digest_module.o \
                ../nginx-http-auth-digest/ngx_http_auth_digest_module.c
../nginx-http-auth-digest/ngx_http_auth_digest_module.c: In function 'ngx_http_auth_digest_decode_auth':
../nginx-http-auth-digest/ngx_http_auth_digest_module.c:297:26: error: variable 'p' set but not used [-Werror=unused-but-set-variable]
   u_char *start, *last, *p;
                          ^
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/nginx-http-auth-digest/ngx_http_auth_digest_module.o] Error 1
make[1]: Leaving directory /usr/local/src/nginx-1.9.9'
make: *** [build] Error 2

real    0m47.208s
user    0m42.551s
sys     0m6.729s
# 

思いっきりエラー出てる。しかもよく見ると今回追加したモジュールの部分じゃないですか。エラー箇所を見てみましょう。

../nginx-http-auth-digest/ngx_http_auth_digest_module.c: In function 'ngx_http_auth_digest_decode_auth':
../nginx-http-auth-digest/ngx_http_auth_digest_module.c:297:26: error: variable 'p' set but not used [-Werror=unused-but-set-variable]
   u_char *start, *last, *p;
                          ^

こんなのwarningでいいじゃん。と思ったらすぐ下に

cc1: all warnings being treated as errors

と無慈悲な言葉が。とりあえずエラー原因となっている変数pを削除してみましょう。

# vim ../nginx-http-auth-digest/ngx_http_auth_digest_module.c 

297行目の

u_char *start, *last, *p;

u_char *start, *last;

にしました。おしまいの*pを消しただけです。

# diff nginx-http-auth-digest/ngx_http_auth_digest_module.c.bak nginx-http-auth-digest/ngx_http_auth_digest_module.c 
297c297
<   u_char *start, *last, *p;
---
>   u_char *start, *last;
# 

さて再挑戦です。

# make clean
rm -rf Makefile objs
# time ./configure   --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_image_filter_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-http_v2_module --with-debug --add-module=../nginx-http-auth-digest --prefix=/usr/local/nginx-1.9.9-digest
#

こちらの結果は変わらなそうなので省略。ではコンパイル。頼むよ。

# time make
またもや略
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/mail -I src/stream \
                -o objs/addon/nginx-http-auth-digest/ngx_http_auth_digest_module.o \
                ../nginx-http-auth-digest/ngx_http_auth_digest_module.c
../nginx-http-auth-digest/ngx_http_auth_digest_module.c: In function 'ngx_http_auth_digest_decode_auth':
../nginx-http-auth-digest/ngx_http_auth_digest_module.c:301:3: error: 'p' undeclared (first use in this function)
   p = ngx_sprintf(key.data,"%s=", field_name);
   ^
../nginx-http-auth-digest/ngx_http_auth_digest_module.c:301:3: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [objs/addon/nginx-http-auth-digest/ngx_http_auth_digest_module.o] Error 1
make[1]: Leaving directory /usr/local/src/nginx-1.9.9'
make: *** [build] Error 2

real    0m44.839s
user    0m40.724s
sys     0m6.202s
# 

まあうまくいくわけ無いです。今度はpが定義されていないって出やがるし。さっきのエラーは何だったのかと。さすがにこのへんでなにかおかしいと思いissuesを見たところコンパイルできないだの認証弾かれるだのだいぶ問題がありそうです。

こちらの投稿を見ると

putnamhill commented on 14 Oct 2015
I had a similar problem (maybe the same). After getting it to compile with with nginx 1.4 and 1.7, the login credentials were always rejected.

I've compiled https://github.com/atomx/nginx-http-auth-digest with nginx 1.9.6 and it works fine.

マジか!?そもそもwikiに書いてあるリポジトリ自体が違うようです。恐るべし公式wiki。恐るべしロシア。

スポンサーリンク
レクタングル大

シェアする

  • このエントリーをはてなブックマークに追加

フォローする

スポンサーリンク
レクタングル大

コメント

  1. […] さて先日の記事でnginxのDigest認証のインストールと設定を行いました。でも果たしてちゃんと動作しているのだろうか?少々気になったので調べてみました。 […]