首页 > V2EX > V2EX-Nginx 安裝 module auth_request 失敗
2022
06-24

V2EX-Nginx 安裝 module auth_request 失敗

cnit:

[root@AliYun conf.d]# nginx -V
nginx version: nginx/1.18.0
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC) 
built with OpenSSL 1.1.1k  FIPS 25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module? --with-http_auth_request_module ?--with-debug --with-cc-opt='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'

[root@AliYun conf.d]# nginx -V 2>&1 | grep -qF -- --with-http_auth_request_module && echo "Module Compiled" || echo "Not Compiled"
Module Compiled
[root@AliYun conf.d]# 


Jun 24 14:57:36 AliYun nginx[87531]: nginx: [emerg] unknown directive? "auth_request"? in /home/nginx/conf/conf.d/xxxx.conf:13
Jun 24 14:57:36 AliYun systemd[1]: nginx.service: Control process exited, code=exited status=1
Jun 24 14:57:36 AliYun systemd[1]: nginx.service: Failed with result 'exit-code'.
Jun 24 14:57:36 AliYun systemd[1]: Failed to start Nginx proxy.
server {
   listen 80;
   listen 443 ssl;
   server_name xxxx;

   underscores_in_headers on;
   include /home/nginx/ssl/ssl.conf;

   location ~ ^/(demos|sig)/ {
         auth_request /console  ?
         proxy_pass http://xxxxx$request_uri;
         proxy_set_header   Host             $host;
         proxy_set_header   X-Real-IP        $remote_addr;
         proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "Upgrade";
         proxy_set_header X-Real-IP $remote_addr;
    }
    ...

指定 configure 参数之后,进行了 make && make install 折騰一天了 大佬帮忙看看吧

from V2EX-最新主题 https://ift.tt/KSudylA
V2EX-Nginx 安裝 module auth_request 失敗 - 第1张  | 牛叻网(NiuL.Net)

最后编辑:
作者:分享菌
这个作者貌似有点懒,什么都没有留下。

留下一个回复