[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 折騰一天了 大佬帮忙看看吧
1
q1angch0u 2022-06-24 15:25:10 +08:00
你 /console 后边儿的分号呢……
|
2
1point 2022-06-24 15:29:09 +08:00
我也感觉是没有;的问题
|
6
cnit OP [root@AliYun conf.d]# ps -ef|grep nginx
root 91899 1 0 15:29 ? 00:00:00 nginx: master process /home/nginx/sbin/ 👈 nobody 91900 91899 0 15:29 ? 00:00:00 nginx: worker process nobody 91901 91899 0 15:29 ? 00:00:00 nginx: worker process nobody 91902 91899 0 15:29 ? 00:00:00 nginx: worker process nobody 91903 91899 0 15:29 ? 00:00:00 nginx: worker process nobody 91904 91899 0 15:29 ? 00:00:00 nginx: cache manager process root 92464 4155721 0 15:36 pts/0 00:00:00 grep --color=auto nginx root 4168638 4155721 0 11:44 pts/0 00:00:00 vim nginx.conf [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- 是这个问题吗? |
8
dier 2022-06-24 15:45:15 +08:00
我觉得应该是#5 说的问题,你这两个路径下都有 nginx ,如果不是做的链接,那说明安装了两个版本。
|
10
cnit OP 我备份了 /home/nginx 然后在其目录下指定了 configure 的路径为当前路径,在 make install 的时候
install: build install_perl_modules test -d '$(DESTDIR)/home/nginx' || mkdir -p '$(DESTDIR)/home/nginx' test -d '$(DESTDIR)/home' \ || mkdir -p '$(DESTDIR)/home' test ! -f '$(DESTDIR)/home/nginx/' \ 👈 这里报错了 || mv '$(DESTDIR)/home/nginx/' \ '$(DESTDIR)/home/nginx/.old' cp objs/nginx '$(DESTDIR)/home/nginx/' sbin-path 指定如下: --sbin-path=/home/nginx/ @q1angch0u |
11
cnit OP 他为啥会给加个 $(DESTDIR) 呢
|
12
cnit OP --prefix 是这个值
|