From 1a26a18f641f92712f7716b8acbd0d1e73a057ff Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Sun, 23 May 2010 19:36:12 +0000 Subject: autodetect redirect if URI is rewritten to a string starting with $scheme --- src/http/modules/ngx_http_rewrite_module.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/http/modules/ngx_http_rewrite_module.c') diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c index b07eedc78..1a474d9d2 100644 --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -341,13 +341,10 @@ ngx_http_rewrite(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) last = 0; - if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0) { - regex->status = NGX_HTTP_MOVED_TEMPORARILY; - regex->redirect = 1; - last = 1; - } - - if (ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0) { + if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0 + || ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0 + || ngx_strncmp(value[2].data, "$scheme", sizeof("$scheme") - 1) == 0) + { regex->status = NGX_HTTP_MOVED_TEMPORARILY; regex->redirect = 1; last = 1; -- cgit