(4)FastCGI、SCGI、uwsgi 三大后端协议改进 在这三个模块(ngx_http_fastcgi_module.c、ngx_http_scgi_module.c、ngx_http_uwsgi_module.c 该参数组统一定义为: { ngx_string("HTTP_HOST"), ngx_string("$host$is_request_port$request_port") } • 优化了 FastCGI、SCGI xml 更新 docs/xml/nginx/changes.xml 文件新增了 1.29.5 的完整变更描述,包括: • 安全更新(CVE-2026-1642) • 多项 bugfix:FastCGI/SCGI 模块一致性增强 FastCGI、SCGI、uwsgi 三者的参数统一,使得多后端协作环境更加一致,减少因头部设置缺失导致的后端错误。 4. 总结要点: • 版本号更新:1.29.5 • 发布日期:2026-02-04 • 核心安全修复:CVE-2026-1642(SSL 上游注入) • 模块优化:SSL、FastCGI、SCGI、uwsgi
fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" 配置完成! ' || cp conf/scgi_params '/export/server/nginx/conf' cp conf/scgi_params '/export/server /nginx/conf/scgi_params.default' test -f '/export/server/nginx/conf/nginx.conf' || cp conf/nginx.conf [root@465d13a11ffa nginx]# ls client_body_temp conf fastcgi_temp html logs proxy_temp sbin scgi_temp
with-http_random_index_module --with-http_stub_status_module --http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp --http-scgi-temp-path =/usr/local/nginx/scgi_temp --with-pcre=/usr/local/src/pcre-8.41 2.2、添加stream模块进行重新编译 此处nginx源码目录为: with-http_random_index_module --with-http_stub_status_module --http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp --http-scgi-temp-path =/usr/local/nginx/scgi_temp --with-pcre=/usr/local/src/pcre-8.41 --with-stream 2.3、进行make操作 此处nginx源码目录为 =/usr/local/nginx/scgi_temp --with-pcre=/usr/local/src/pcre-8.41 --with-stream 可以看到stream模块已经编译到nginx
cp conf/uwsgi_params '/usr/local/nginx/conf/uwsgi_params.default' test -f '/usr/local/nginx/conf/scgi_params ' || cp conf/scgi_params '/usr/local/nginx/conf' cp conf/scgi_params '/usr/local/nginx/conf/scgi_params.default
Web服务器和FastCGI/SCGI服务器 进一步,FastCGI还支持同时响应多个请求。 scgi.rb scgi.rb是对SCGI协议的纯Ruby实现。从原理上来看,SCGI和FastCGI类似,二者的性能并无多大差别。 但比起后者复杂的协议内容来说,SCGI移除了许多非必要的功能,看起来十分简洁,且实现复杂度更低。 ? Web服务器和多FastCGI/SCGI服务器 与FastCGI类似,一个SCGI服务器可以动态创建服务器子进程用于处理更多请求(处理完毕将转入睡眠),直至达到配置的子进程上限。 当获得Web服务器请求时,SCGI服务器进程会将其转发至子进程,并由子进程运行CGI程序处理该请求。此外,SCGI还能自动销毁退出和崩溃的子进程,具有良好的稳定性。
/ /awstats/ /cgi-bin/awstats/ /scgi-bin/awstats/ /cgi/awstats/ /scgi/awstats /cgi-bin/inc/includer.cgi /scgi-bin/inc/includer.cgi /cgi-local/includer.cgi /scgi-local scgi/hints.pl /cgi-bin/hints.pl /scgi-bin/hints.pl /hints/hints.pl /cgi-bin/hints /scgi-bin/webhints/hints.pl /hints.cgi /cgi/hints.cgi /scgi/hints.cgi /cgi-bin/hints.cgi /scgi-bin/hints.cgi /hints/hints.cgi /cgi-bin/hints/hints.cgi /scgi-bin/hints/hints.cgi
http-fastcgi-temp-path=/var/temp/nginx/fastcgi \ --http-uwsgi-temp-path=/var/temp/nginx/uwsgi \ --http-scgi-temp-path =/var/temp/nginx/scgi 注:代表在命令行中换行,用于提高可读性 配置命令: 命令 解释 –prefix 指定nginx安装目录 –pid-path 指向nginx的pid –lock-path http-proxy-temp-path 设定http代理临时目录 –http-fastcgi-temp-path 设定fastcgi临时目录 –http-uwsgi-temp-path 设定uwsgi临时目录 –http-scgi-temp-path 设定scgi临时目录 make编译 make 2.
│ ├── mime.types │ ├── mime.types.default │ ├── nginx.conf │ ├── nginx.conf.default │ ├── scgi_params │ ├── scgi_params.default │ ├── uwsgi_params │ ├── uwsgi_params.default │ └── win-utf ├── html
[root@localhost ~]# ls /etc/nginx/conf.d fastcgi.conf fastcgi\_params koi-utf mime.types nginx.conf scgi win-utfdefault.d fastcgi.conf.default fastcgi\_params.default koi-win mime.types.default nginx.conf.default scgi ls /etc/nginx/conf.d fastcgi.conf fastcgi\_params koi-utf mime.types nginx.conf nginx.conf.default scgi params.defaultdefault.d fastcgi.conf.default fastcgi\_params.default koi-win mime.types.default nginx.conf.bak scgi
http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \ --http-scgi-temp-path =/var/tmp/nginx/scgi make && make install ln -s /usr/local/nginx/sbin/nginx /usr/sbin/ 可参考:Nginx编译参数解析 http-fastcgi-temp-path #设置http fastcgi临时文件路径 –http-uwsgi-temp-path=/var/tmp/nginx/uwsgi #设置uwsgi 临时文件路径 –http-scgi-temp-path =/var/tmp/nginx/scgi #设置scgi 临时文件路径 3、开机自启动 nginx 脚本 vim /etc/init.d/nginx 进入编辑模式,键入以下脚本内容: #!
│ ├── mime.types.default《==媒体类型模板 │ ├── nginx.conf《==主配置文件 │ ├── nginx.conf.default《==主配置文件模板 │ ├── scgi_params │ ├── scgi_params.default《==都是动态服务接口配置 │ ├── uwsgi_params《==配合python服务 │ ├── uwsgi_params.default │ ── error.log《==错误日志 │ └── nginx.pid《==进程pid文件 ├── proxy_temp《==临时文件 ├── sbin │ └── nginx《==启动命令 ├── scgi_temp
http-fastcgi-temp-path=/var/temp/nginx/fastcgi \--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \--http-scgi-temp-path =/var/temp/nginx/scgi \--with-http_ssl_module编译安装makemake install查看Nginx详情[root@localhost nginx-1.16.1 -http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path =/var/temp/nginx/scgi --with-http_ssl_module[root@localhost nginx]#可以看到SSL已经安装上了配置证书upstream tomcats
fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" [root@test nginx-1.5.7]# make [root@test nginx-1.5.7]# make install fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" [root@test nginx-1.5.7]# make [root@test nginx-1.5.7]# make install 测试 proxy_temp drwxr-xr-x 2 root root 4096 Nov 26 21:23 sbin drwx------ 2 nobody root 4096 Nov 26 21:24 scgi_temp
http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp —http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp —http-scgi-temp-path =/var/cache/nginx/scgi_temp —user=nginx —group=nginx —with-http_ssl_module —with-http_realip_module — http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp —http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp —http-scgi-temp-path =/var/cache/nginx/scgi_temp —user=nginx —group=nginx —with-http_ssl_module —with-http_realip_module — =/var/cache/nginx/scgi_temp —user=nginx —group=nginx —with-http_ssl_module —with-http_realip_module —
--http-fastcgi-temp-path=PATH 设置 FastCGI 临时文件的目录 --http-uwsgi-temp-path=PATH 设置 uWSG工临时文件的目录 --http-scgi-temp-path disable ngx_http_scgi_module --without-http_grpc_module disable ngx_http_grpc_module /nginx/fastcgi_temp" nginx http uwsgi temporary files: "/var/cache/nginx/uwsgi_temp" nginx http scgi temporary files: "/var/cache/nginx/scgi_temp" 编译与安装 make && make install #安装成功执行以下命令查看nginx版本号 [root =/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads -
mime.types.default | |-- nginx.conf #这是Nginx默认的主配置文件 | |-- nginx.conf.default | |-- scgi_params #scgi相关参数文件,一般用不到 | |-- scgi_params.default | |-- uwsgi_params proxy_temp #临时目录 |-- sbin #这是Nginx命令的目录,如Nginx的启动命令nginx | `-- nginx #Nginx的启动命令nginx |-- scgi_temp
http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-scgi-temp-path =/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --pid-path=/run/nginx.pid -- http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-scgi-temp-path =/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --pid-path=/run/nginx.pid -- =/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --pid-path=/run/nginx.pid --
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 -- =/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx -- /lib/nginx/tmp/fastcgi" nginx http uwsgi temporary files: "/var/lib/nginx/tmp/uwsgi" nginx http scgi temporary files: "/var/lib/nginx/tmp/scgi" 这表示你安装成功。
]# ls nginx01/ && ls nginx02 && ls nginx03 conf.d fastcgi_params mime.types modules nginx.conf scgi_params uwsgi_params conf.d fastcgi_params mime.types modules nginx.conf scgi_params uwsgi_params conf.d fastcgi_params mime.types modules nginx.conf scgi_params uwsgi_params 创建网络 docker network create
--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-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --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-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6