# HG changeset patch # User Igor Sysoev # Date 1213973308 0 # Node ID 989176d3ffc53525b94c6055732835f5eb977ad6 # Parent dd5ca07f5cdd91d8b8a45851d8a32335f6e31251 auto detect https redirect in rewrite diff -r dd5ca07f5cdd -r 989176d3ffc5 src/http/modules/ngx_http_rewrite_module.c --- a/src/http/modules/ngx_http_rewrite_module.c Fri Jun 20 14:43:17 2008 +0000 +++ b/src/http/modules/ngx_http_rewrite_module.c Fri Jun 20 14:48:28 2008 +0000 @@ -357,6 +357,12 @@ last = 1; } + if (ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0) { + regex->status = NGX_HTTP_MOVED_TEMPORARILY; + regex->redirect = 1; + last = 1; + } + if (cf->args->nelts == 4) { if (ngx_strcmp(value[3].data, "last") == 0) { last = 1;