1: 官网下载: nginx: download
2: 步骤:
1: 系统更新: sudo dnf update
2:安装系统依赖: sudo dnf install gcc-c++ pcre-devel zlib-devel openssl-devel make automake
3:在https://nginx.org/en/download.html 下载 nginx-1.25.4.tar.gz
4: 在Nginx源码文件被解压后,找到源码目录下的auto/cc/gcc文件,在其中找到如下几行:在最底下几行# debug
CFLAGS=”$CFLAGS -g”
注释掉或删掉这两行,即可取消debug模式5: 配置
./configure \
--prefix=/usr/local/nginx \
--prefix=/usr/local/nginx \
--conf-path=/usr/local/nginx/conf/nginx.conf \
--error-log-path=/usr/local/nginx/logs/error.log \
--http-log-path=/usr/local/nginx/logs/access.log \
--pid-path=/usr/local/nginx/nginx.pid \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--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_stub_status_module \
--with-http_auth_request_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-threads
6: 执行 make && make install