{"id":21363085,"url":"https://github.com/hanadalee/ngx_core_patches","last_synced_at":"2026-03-09T19:03:50.179Z","repository":{"id":240069037,"uuid":"747562563","full_name":"HanadaLee/ngx_core_patches","owner":"HanadaLee","description":"Enhance nginx core to implement more functions","archived":false,"fork":false,"pushed_at":"2024-10-24T15:37:01.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-25T21:20:40.479Z","etag":null,"topics":["nginx","nginx-patch","openresty"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HanadaLee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-24T07:21:31.000Z","updated_at":"2024-10-24T15:37:05.000Z","dependencies_parsed_at":"2024-06-23T02:17:13.243Z","dependency_job_id":"e2bd8198-3711-4294-af96-53fac2a0a1c8","html_url":"https://github.com/HanadaLee/ngx_core_patches","commit_stats":null,"previous_names":["hanadalee/ngx_core_patches"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_core_patches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_core_patches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_core_patches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_core_patches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HanadaLee","download_url":"https://codeload.github.com/HanadaLee/ngx_core_patches/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225850248,"owners_count":17534085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx","nginx-patch","openresty"],"created_at":"2024-11-22T06:17:44.962Z","updated_at":"2025-10-31T07:39:21.731Z","avatar_url":"https://github.com/HanadaLee.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngx_core_patches\n\nWARNING: This repository has been deprecated, all patches have been integrated into patch path of [openresty](https://github.com/HanadaLee/openresty/tree/main/patches)\n\nEnhance nginx core to implement more functions\n\n## ngx_http_slice_filter_module_ext_1.21.4+.patch\n\nThis patch introduces a directive slice_allow_methods to control which request methods can be sliced. In addition, slice_check_etag and slice_check_last_modified are also introduced to control whether to check the consistency of these two headers.\n\n* **Syntax:** *slice_allow_methods GET | HEAD ...;*\n\n* **Default:** *slice_allow_methods GET HEAD;*\n\n* **Context:** *http, server, location*\n\nAllow splitting responses into slices if the client request method is listed in this directive. Note that if the slice directive is unset or has the zero value, splitting the response into slices will still be disabled.\n\n* **Syntax:** *slice_check_etag on | off;*\n\n* **Default:** *slice_check_etag on;*\n\n* **Context:** *http, server, location*\n\nWhether to check the consistency of the Etag header in the slice. If it is enabled, the request will be terminated and an error will be reported when Etag mismatch in slice response occurs.\n\n* **Syntax:** *slice_check_last_modified on | off;*\n\n* **Default:** *slice_check_last_modified off;*\n\n* **Context:** *http, server, location*\n\nWhether to check the consistency of the Last-Modified header in the slice. If it is enabled, the request will be terminated and an error will be reported when Last-Modified mismatch in slice response occurs.\n\n## ngx_http_sub_filter_module_ext_1.25.3+.patch\n\nThis patch introduces a directive sub_filter_bypass to bypass sub_filter based on the value of a set of variables.\n\n* **Syntax:** *sub_filter_bypass string ...;*\n\n* **Default:** *—*\n\n* **Context:** *http, server, location*\n\nDefines conditions under which the response will not be replaced. If at least one value of the string parameters is not empty and is not equal to “0” then the response will not be replaced.\n\n```\nsub_filter_bypass $cookie_nocache $arg_nocache$arg_comment;\nsub_filter_bypass $http_pragma    $http_authorization;\n```\n\n## ngx_http_listen_https_allow_http_1.21.4+.patch\n\nThis patch allows accepting http or https requests in the same port, which is useful for scenarios where special ports are used. The original work is from [Tengine](https://github.com/alibaba/tengine).\n\n* **Syntax:** *listen address[:port] [ssl] **[https_allow_http]** ...;*\n\n* **Default:** *listen *:80 | *:8000;*\n\n* **Context:** *server*\n\nWhen both the ssl and https_allow_http parameters are enabled for the listen directive, both https or http requests will be allowed.\n\n## ngx_http_proxy_and_grpc_header_control_inherit_1.25.3+.patch\n\nDeprecated, please use ngx_http_proxy_module_ext_1.25.3+.patch\n\n## ngx_http_proxy_module_ext_1.25.3+.patch\n\nThis patch introduces the 'proxy_set_header_inherit' directive\nwhich blocks the merge inheritance in receiving contexts when set to off. The purpose of the added mechanics is to reduce repetition within the\nnginx configuration for universally set (or boilerplate) request\nheaders, while maintaining flexibility to set additional headers for\nspecific paths.\nThe original patch is from https://mailman.nginx.org/pipermail/nginx-devel/2023-November/XUGFHDLSLRTFLWIBYPSE7LTXFJHNZE3E.html\nThis patch additionally provides grpc support, Also allows setting the :authory header (From https://github.com/api7/apisix-nginx-module/blob/main/patch/1.25.3.1/nginx-grpc_set_header_authority.patch).\n\nTo enhance control over upstream cache behavior, this patch introduces some new cache-related directives.\n\nThere is no change in behavior for existing configurations.\n\n* **Syntax:** *proxy_set_header_inherit on | off;*\n\n* **Default:** *proxy_set_header_inherit off;*\n\n* **Context:** *http, server, location*\n\nAllows the merge inheritance of proxy_set_header in receiving contexts.\n\n* **Syntax:** *grpc_set_header_inherit on | off;*\n\n* **Default:** *grpc_set_header_inherit off;*\n\n* **Context:** *http, server, location*\n\nAllows the merge inheritance of grpc_set_header in receiving contexts.\n\n* **Syntax:** *proxy_ignore_cache_control field ...;*\n\n* **Default:** *-*\n\n* **Context:** *http, server, location*\n\nDisables processing of certain fields of Cache-Control header in the response from upstream. The following directives can be ignored:\n\n* no-cache\n* no-store\n* private\n* max-age\n* s-maxage\n* stale-while-revalidate\n* stale-if-error\n\n\u003e fastcgi_ignore_cache_control, scgi_ignore_cache_control, uwsgi_ignore_cache_control directives are also available.\n\n* **Syntax:** *proxy_cache_min_age time;*\n\n* **Default:** *proxy_cache_min_age 0s;*\n\n* **Context:** *http, server, location*\n\nIf the received max-age/s-maxage of Cache-Control header from upstream is less than the specified minimum age, the max-age/s-maxage value is set to the configured minimum age value. For example, if the max-age/s-maxage value in the received HTTP header is 100s and the configured minimum age value is 200s, the effective cache time will be 200s. This directive does not rewrite the Cache-Control header.\n\n\u003e fastcgi_cache_min_age, scgi_cache_min_age, uwsgi_cache_min_age directives are also available.\n\n* **Syntax:** *proxy_cache_stale_if_error time;*\n\n* **Default:** *proxy_cache_stale_if_error 0s;*\n\n* **Context:** *http, server, location*\n\nThe stale-if-error extension of the Cache-Control header field permits using a stale cached response in case of an error. When stale-if-error is missing from Cache-Control header, this directive will take effect instead of the stale-if-error extension of the Cache-Control header. This directive has lower priority than using the directive parameters of proxy_cache_use_stale.\n\n\u003e fastcgi_cache_stale_if_error, scgi_cache_stale_if_error, uwsgi_cache_stale_if_error directives are also available.\n\n* **Syntax:** *proxy_cache_stale_while_revalidate time;*\n\n* **Default:** *proxy_cache_stale_while_revalidate 0s;*\n\n* **Context:** *http, server, location*\n\nThe stale-while-revalidate extension of the Cache-Control header field permits using a stale cached response if it is currently being updated. When stale-while-revalidate is missing from Cache-Control header, this directive will take effect instead of the stale-while-revalidate extension of the Cache-Control header. This directive has lower priority than using the directive parameters of proxy_cache_use_stale.\n\n\u003e fastcgi_cache_stale_while_revalidate, scgi_cache_stale_while_revalidate, uwsgi_cache_stale_while_revalidate directives are also available.\n\n## ngx_http_realip_module_ext_1.25.3+.patch\n\n* **Syntax:** *real_ip_header field | X-Real-IP | X-Forwarded-For | proxy_protocol;*\n\n* **Default:** *real_ip_header X-Real-IP;*\n\n* **Context:** *http, server, location*\n\nDefines the request header fields whose value will be used to replace the client address. \n\nIf multiple request fields are defined, the header values ​​will be checked in the order defined in the configuration, and the first header with a valid value will be used:\n\n```\nreal_ip_header X-Real-IP Cdn-Src-Ip X-Forwarded-For;\n```\nThe values ​​of the above headers will be checked in turn until a valid value is found.\n\nThe request header field value that contains an optional port is also used to replace the client port . The address and port should be specified according to RFC 3986.\n\nThe proxy_protocol parameter changes the client address to the one from the PROXY protocol header. The PROXY protocol must be previously enabled by setting the proxy_protocol parameter in the listen directive.\n\n## ngx_http_rewrite_module_if_extend_1.25.3+.patch\n\nThe original work is from [SEnginx](https://github.com/NeusoftSecurity/SEnginx).\n\nThis patch extends the \"if\" directive of the original NGINX \"rewrite\" module. It has the following features:\n\n### more conditions for \"if\" directive\n\nSupports matching multiple conditions and the matching conditions can be \"and\" or \"or\".\nExcept for the original \"if\" condition operators, also supports:\n* \u003c\n* \\\u003e\n* !\u003c or \u003e=\n* !\u003e or \u003c=\n\n### \"if\" with multi conditions\n\n* **Syntax:** *if_all (condition 1) (condition 2) ... {...}*\n\n* **Default:** *-*\n\n* **Context:** *server, location*\n\nSpecify multiple conditions. If all conditions are true, then execute the directives inside the braces\"{}\". This directive has the same behavior as the original \"if\" directive, but the following condition operators are added:\n* \u003c\n* \\\u003e\n* !\u003c or \u003e=\n* !\u003e or \u003c=\n\nExample:\n```\nif_all ($remote_addr = 192.168.1.1) ($http_user_agent ~ 'Mozilla') ($server_port \u003e 808) {\n    return 404;\n}\n```\n\n* **Syntax:** *if_any (condition 1) (condition 2) ... {...}*\n\n* **Default:** *-*\n\n* **Context:** *server, location*\n\nSpecify multiple conditions. If any condition is true, then execute the directives inside the braces \"{}\". The other parts are the same as the \"if_all\" directive.\n\nKnown limits: \n\nThe last character of a conditional statement cannot be ')', even if it is enclosed in quotes. For example, the following expression will cause a configuration test error.\n```\nif_all ($test_var = \"test)\") ($http_user_agent ~ 'Mozilla') ($server_port \u003e 808) {\n    return 404\n}\n```\nIf you must use a string ending with ')'， you might consider using a variable to back it up.\n```\nset $value \"test)\";\nif_all ($test_var = $value) ($http_user_agent ~ 'Mozilla') ($server_port \u003e 808) {\n    return 404\n}\n```\nIf it is a regular expression, we can avoid using ')' at the end in many ways.\n\n## ngx_http_default_error_page_optimize_1.25.3+.patch\n\nThis patch is used to optimize the information displayed on the default error page to facilitate the collection of error feedback from clients.\n\n* **Syntax:** *error_page_server_info on | off*\n\n* **Default:** *error_page_server_info on*\n\n* **Context:** *http, server, location*\n\nShow up the following information in a default 4xx/5xx error page: The date, request client ip, the request id, and the hostname serving the request are included.\n\n* **Syntax:** *error_page_client_ip string*\n\n* **Default:** *-*\n\n* **Context:** *http, server, location*\n\nSpecify the value of the ip item to be displayed on the default 4xx/5xx error page. Parameter value can contain variables. The value will be displayed on the default \n4xx/5xx error page only when the error_page_server_info directive is enabled.\n\n* **Syntax:** *error_page_request_id string*\n\n* **Default:** *-*\n\n* **Context:** *http, server, location*\n\nSpecify the value of the request id item to be displayed on the default 4xx/5xx error page. Parameter value can contain variables. The value will be displayed on the default 4xx/5xx error page only when the error_page_server_info directive is enabled.\n\n## ngx_http_gunzip_force_1.25.3+\n\nThis is a simple patch modifying the NGINX gunzip filter module to force inflate compressed responses. This is desirable in the context of an upstream source that sends responses gzipped. Please read the \"other comments\" section to understand this will decompress all content, so you want to specify its use as specific as possible to avoid decompressing content that you otherwise would want left untouched.\n\nThis serves multiple purposes:\n\nIt maintains transfering gzipped content between upstream server(s) and nginx, thus reducing network bandwidth.\nSome modules require the upstream content to be uncompressed to work properly.\nIt allows nginx to recompress the data (i.e. brotli) before sending to the client.\nThis has been successfully tested up to version 1.20.0 (the current release as of this writing). I don't think the gunzip module code changes much (if any), so it should patch cleanly against older / future versions.\n\nThe original patch is from http://mailman.nginx.org/pipermail/nginx-devel/2013-January/003276.html. The original author is Weibin Yao.\n\nNOTE: The gunzip module is not built by default, you must specify --with-http_gunzip_module when compiling nginx.\n\n* **Syntax:** *gunzip_force on | off*\n\n* **Default:** *gunzip_force off*\n\n* **Context:** *http, server, location*\n\nEnables or disables forced decompression of upstream content.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanadalee%2Fngx_core_patches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanadalee%2Fngx_core_patches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanadalee%2Fngx_core_patches/lists"}