Skip to content

Commit 6f67162

Browse files
committed
Move redirection io to post access phase
1 parent 840aaac commit 6f67162

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/ngx_http_redirectionio_module.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,7 @@ static ngx_int_t ngx_http_redirectionio_postconfiguration(ngx_conf_t *cf) {
137137

138138
*log_handler = ngx_http_redirectionio_log_handler;
139139

140-
#ifdef NGX_HTTP_PRECONTENT_PHASE
141-
redirect_handler = ngx_array_push(&cmcf->phases[NGX_HTTP_PRECONTENT_PHASE].handlers);
142-
#else
143-
redirect_handler = ngx_array_push(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers);
144-
#endif
140+
redirect_handler = ngx_array_push(&cmcf->phases[NGX_HTTP_POST_ACCESS_PHASE].handlers);
145141

146142
if (redirect_handler == NULL) {
147143
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cf->cycle->log, 0, "redirectionio: init(): error pushing redirect handler");
@@ -151,7 +147,7 @@ static ngx_int_t ngx_http_redirectionio_postconfiguration(ngx_conf_t *cf) {
151147
*redirect_handler = ngx_http_redirectionio_redirect_handler;
152148

153149
// Create context handler -> pre access phase
154-
create_ctx_handler = ngx_array_push(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers);
150+
create_ctx_handler = ngx_array_push(&cmcf->phases[NGX_HTTP_POST_ACCESS_PHASE].handlers);
155151

156152
if (create_ctx_handler == NULL) {
157153
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cf->cycle->log, 0, "redirectionio: init(): error pushing ctx handler");

0 commit comments

Comments
 (0)