summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-11-27 14:13:48 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-11-27 14:13:48 +0000
commitacd2f06a35612343ffb305d7054ae57cdf4ad673 (patch)
tree040ade7c3d6b0f7bbea828974e4b3ffdfd9275d9
parenta1f5df89d1564d924203fbb5a16618d981507856 (diff)
downloadnginx-acd2f06a35612343ffb305d7054ae57cdf4ad673.tar.gz
nginx-acd2f06a35612343ffb305d7054ae57cdf4ad673.tar.bz2
r2055 merge:
auto detect https redirect in rewrite
-rw-r--r--src/http/modules/ngx_http_rewrite_module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c
index 341e05424..249b3201d 100644
--- a/src/http/modules/ngx_http_rewrite_module.c
+++ b/src/http/modules/ngx_http_rewrite_module.c
@@ -357,6 +357,12 @@ ngx_http_rewrite(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
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;