{"id":24296624,"url":"https://github.com/hanadalee/ngx_http_internal_redirect_module","last_synced_at":"2026-05-14T12:34:36.960Z","repository":{"id":271605786,"uuid":"912956607","full_name":"HanadaLee/ngx_http_internal_redirect_module","owner":"HanadaLee","description":"A nginx module to make an internal redirect to the uri specified","archived":false,"fork":false,"pushed_at":"2026-04-16T16:05:47.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-16T18:11:28.142Z","etag":null,"topics":["nginx","nginx-module"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","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":"LICENSE","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":"2025-01-06T18:31:23.000Z","updated_at":"2026-04-16T16:05:51.000Z","dependencies_parsed_at":"2025-01-08T19:41:07.138Z","dependency_job_id":"01503409-7cd1-43bb-9818-7351908db46b","html_url":"https://github.com/HanadaLee/ngx_http_internal_redirect_module","commit_stats":null,"previous_names":["hanadalee/ngx_http_internal_redirect_module"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HanadaLee/ngx_http_internal_redirect_module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_http_internal_redirect_module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_http_internal_redirect_module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_http_internal_redirect_module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_http_internal_redirect_module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HanadaLee","download_url":"https://codeload.github.com/HanadaLee/ngx_http_internal_redirect_module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanadaLee%2Fngx_http_internal_redirect_module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33025151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-module"],"created_at":"2025-01-16T19:25:10.651Z","updated_at":"2026-05-14T12:34:36.955Z","avatar_url":"https://github.com/HanadaLee.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Name\n\n`ngx_http_internal_redirect_module` allows making an internal redirect. In contrast to rewriting URIs, the redirection is made after rewrite phase. Currently supported request phases are preaccess, access, precontent and content, allowing it to be used with many nginx official or third-party modules.\n\n\u003e This module is inspired by the nginx official [ngx_http_internal_redirect_module]([ngx_http_internal_redirect_module](https://nginx.org/en/docs/http/ngx_http_internal_redirect_module.html)).\n\n# Table of Content\n\n- [Name](#name)\n- [Table of Content](#table-of-content)\n- [Status](#status)\n- [Synopsis](#synopsis)\n- [Installation](#installation)\n- [Directives](#directives)\n  - [internal\\_redirect](#internal_redirect)\n- [Author](#author)\n- [License](#license)\n\n# Status\n\nThis Nginx module is currently considered experimental. Issues and PRs are welcome if you encounter any problems.\n\n# Synopsis\n\n```nginx\nserver {\n    listen 127.0.0.1:80;\n    server_name localhost;\n\n    location /old {\n        internal_redirect -i ^/old(.+) /new$1 phase=preaccess;\n    }\n\n    location /new {\n        return 200 'current uri is: $uri';\n    }\n}\n```\n\n# Installation\n\nTo use theses modules, configure your nginx branch with `--add-module=/path/to/ngx_http_internal_redirect_module`.\n\n# Directives\n\n## internal_redirect \n\n**Syntax:** *internal_redirect [-i] pattern replacement [phase=\u003cphase\u003e] [flag=\u003cflag\u003e] [if=\u003ccondition\u003e | if!=\u003ccondition\u003e]*\n\n**Default:** *-*\n\n**Context:** *http, server, location*\n\nSets the new URI for internal redirection of the request. It is also possible to use a named location instead of the URI. The replacement value can contain variables. If the uri value is empty, then the redirect will not be made. After an internal redirect occurs, the request URI will be changed, and request will be returns to the NGX_HTTP_SERVER_REWRITE_PHASE (server_rewrite) phase. The request proceeds with a server default location. Later at NGX_HTTP_FIND_CONFIG_PHASE (find_config) a new location is chosen based on the new request URI.\n\n\u003e For more information about nginx request phases, please refer to [Development guide#http_phases](https://nginx.org/en/docs/dev/development_guide.html#http_phases)\n\nThe optional `-i` parameter specifies that a case-insensitive regular expression match should be performed.\n\nThe optional `phase=` parameter is used to indicate the phase in which this rule takes effect. The possible values ​​are preaccess, access, precontent and content. The rules of each phase will be executed completely before the internal redirection is performed. The default value is preaccess.\n\nThe optional `flag=` parameter is used for additional actions after evaluating the rule. The value of this parameter can be one of:\n* `break`\nstops processing the current set of rules at this phase, and immediately executes an internal redirection;\n* `http_301`\nstops processing the current set of rules at this phase, and immediately returns a redirection with the 301 code.\n* `http_302`\nstops processing the current set of rules at this phase, and immediately returns a redirection with the 302 code.\n* `http_303`\nstops processing the current set of rules at this phase, and immediately returns a redirection with the 303 code.\n* `http_307`\nstops processing the current set of rules at this phase, and immediately returns a redirection with the 307 code.\n* `http_308`\nstops processing the current set of rules at this phase, and immediately returns a redirection with the 308 code.\n\nThe `if` parameter enables conditional redirection. A request will not be redirected if the condition evaluates to “0” or an empty string. You can also use the form of `if!=` to make negative judgments.\n\nThe rules of the previous level will be merged into the rules of the current level.\n\n# Author\n\nHanada im@hanada.info\n\n# License\n\nThis Nginx module is licensed under [BSD 2-Clause License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanadalee%2Fngx_http_internal_redirect_module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanadalee%2Fngx_http_internal_redirect_module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanadalee%2Fngx_http_internal_redirect_module/lists"}