Nginx를 시작할 수 없습니다. Brotli 구성 오류입니다.

Nginx를 시작할 수 없습니다. Brotli 구성 오류입니다.

Debian 9 OS에서 apache2의 역방향 프록시로 nginx 서버를 설정했습니다. Apache2는 80이 아닌 다른 포트에서 실행 중입니다. certbot을 사용하여 내 사이트의 인증서를 갱신하려고 했는데 프로세스 도중 어딘가에서 다음 명령을 실행했습니다.

$ sudo apt install python3-certbot-nginx

나는 이것이 내 컴퓨터에 nginx 서버의 새로운 사본을 설치했다고 생각합니다(내가 틀렸다면 정정해 주십시오). 그 이후로 nginx를 시작할 수 없습니다. 다음은 테스트 명령의 결과입니다.

nginx -t:

nginx: [emerg] dlopen() "/usr/share/nginx/nginx/modules/ngx_http_brotli_filter_module.so" failed (/usr/share/nginx/nginx/modules/ngx_http_brotli_filter_module.so: cann
ot open shared object file: No such file or directory) in /etc/nginx/modules.conf.d/brotli.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed

nginx -V:

nginx version: nginx/1.10.3
built with OpenSSL 1.1.0l  10 Sep 2019
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-8G38mz/nginx-1.10.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --er
ror-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/va
r/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-tem
p-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_r
equest_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-
http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic 
--with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-8G38mz/nginx-1.10.3/debian/modules/nginx-auth-pam --add-dynamic-m
odule=/build/nginx-8G38mz/nginx-1.10.3/debian/modules/nginx-dav-ext-module --add-dynamic-module=/build/nginx-8G38mz/nginx-1.10.3/debian/modules/nginx-echo --add-dynami
c-module=/build/nginx-8G38mz/nginx-1.10.3/debian/modules/nginx-upstream-fair --add-dynamic-module=/build/nginx-8G38mz/nginx-1.10.3/debian/modules/ngx_http_substitution
s_filter_module

sudo systemctl status nginx:

nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2022-04-11 01:20:12 CEST; 14min ago
     Docs: man:nginnginx: [emerg] dlopen() "/usr/share/nginx/nginx/modules/ngx_http_brotli_filter_module.so" failed (/usr/share/nginx/nginx/modules/ngx_http_brotli_filter_module.so: cann
ot open shared object file: No such file or directory) in /etc/nginx/modules.conf.d/brotli.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failedx(8)
  Process: 22395 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Apr 11 01:20:12 cp-com-vm systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 11 01:20:12 cp-com-vm nginx[22395]: nginx: [emerg] dlopen() "/usr/share/nginx/nginx/modules/ngx_http_brotli_filter_module.so" failed (/usr/share/nginx/nginx/module
Apr 11 01:20:12 cp-com-vm nginx[22395]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 11 01:20:12 cp-com-vm systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 11 01:20:12 cp-com-vm systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 11 01:20:12 cp-com-vm systemd[1]: nginx.service: Unit entered failed state.
Apr 11 01:20:12 cp-com-vm systemd[1]: nginx.service: Failed with result 'exit-code'.

nginx.conf:

   #user  nginx;
 worker_processes  1;

#error_log  /var/log/nginx/error.log;
 #error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

 #pid        /var/run/nginx.pid;

 include /etc/nginx/modules.conf.d/*.conf;

events {
worker_connections  1024;
}

 http {
include       mime.types;
default_type  application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                  '$status $body_bytes_sent "$http_referer" '
#                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;
#tcp_nodelay        on;

#gzip  on;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";

server_tokens off;

include /etc/nginx/conf.d/*.conf;
client_max_body_size 512M;
}

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;

brotli.conf:

load_module nginx/modules/ngx_http_brotli_filter_module.so;
load_module nginx/modules/ngx_http_brotli_static_module.so;

서버를 아무 소용 없이 백업하는 방법에 대해 여러 사이트에서 많은 답변을 시도했습니다. 누군가 정확한 문제를 지적해 줄 수 있습니까? 참고로 나중에 인증서를 갱신할 수 있어서 이제 이 문제만 남았습니다. 티아

답변1

아무리 노력해도 당시의 nginx 설치를 수정할 수 없었습니다. brotli를 별도로 설치하고 구성에서 주석을 달았음에도 nginx.conf가 항상 실패했습니다.

다시 시작하고 실행하려면 nginx 인스턴스를 제거하고 다시 설치해야 했습니다.

apt-get purge nginx nginx-common nginx-full
apt-get install nginx

관련 정보