summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-06-07 11:51:37 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-06-07 11:51:37 +0000
commita16387eba9b14d48be0e0644f6030f880b652836 (patch)
treed8c656540294d47c81a0d46e2cbb5fab566c5fe0 /src/http
parent7fbe27b79f67b44412b061c6ac9b4aaa9f8c1f1a (diff)
downloadnginx-a16387eba9b14d48be0e0644f6030f880b652836.tar.gz
nginx-a16387eba9b14d48be0e0644f6030f880b652836.tar.bz2
merge r3487, r3525:
rewrite fixes: *) escape ampersand in argument while rewrite *) autodetect redirect if URI is rewritten to a string starting with $scheme
Diffstat (limited to 'src/http')
-rw-r--r--src/http/modules/ngx_http_rewrite_module.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c
index 1f98cf829..61090317b 100644
--- a/src/http/modules/ngx_http_rewrite_module.c
+++ b/src/http/modules/ngx_http_rewrite_module.c
@@ -340,13 +340,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;