linux - 无法修补 nginx 源(找不到要修补的文件)

标签 linux nginx patch

我正在尝试修补 nginx 源代码,但它一直给我这个错误

[root@server nginx-1.2.6]# patch -p0 < 0004-Accept-variable-name-as-upload_limit_rate-argument.patch
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 8f4cad171fe4fed9cbd11a6a10fb4880e49bf9f6 Mon Sep 17 00:00:00 2001
|From: Valentin Dudouyt <valentin.dudouyt@gmail.com>
|Date: Fri, 12 Feb 2016 11:28:56 +0600
|Subject: [PATCH] Accept variable name as upload_limit_rate argument
|
|---
| ngx_http_upload_module.c | 27 +++++++++++++++++----------
| 1 file changed, 17 insertions(+), 10 deletions(-)
|
|diff --git a/ngx_http_upload_module.c b/ngx_http_upload_module.c
|index 93ded70..6bd5027 100644
|--- a/ngx_http_upload_module.c
|+++ b/ngx_http_upload_module.c
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
7 out of 7 hunks ignored

为什么我收到此错误

最佳答案

  1. 您尝试修补的文件是 nginx 模块 ( nginx-upload-module ) 的一部分,而不是 nginx 本身的一部分。除非您将其放在那里,否则它不会存在于 nginx 源代码中。

  2. 您尝试修补的 nginx 版本很旧。当前版本是1.12; 1.2 分支的最后一次更新是在 2013 年 (1.2.9),即使如此,它仍然缺少几个重要的安全版本。

  3. nginx-upload-module 已失效。该项目的最后一次提交是在 2008 年(9 年前!!),该模块与当前版本的 nginx 不兼容。

关于linux - 无法修补 nginx 源(找不到要修补的文件),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44294000/

相关文章:

linux - 如何将linux内核迁移到更高的内核版本

linux - UDP 在同一台机器上广播?

python - 如何通过 Python 为 Windows 和 Linux 获取用户登录/注销时间?

c++ - 如何获取程序的堆大小

mysql - Node mysql 错误 : connect ECONNREFUSED

ssl - nginx 加载 ssl 证书失败

linux - 使用hadoop2(YARN)时出现连接异常

php - 我应该在 nginx.conf 中还是使用 Laravel config/cors.php 添加我的 CORS header ?

php - PATCH/PUT 不接受多部分/表单数据文件上传?

elasticsearch - Elasticsearch集群中所有节点的滚动节点重启