Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-06-20 18:48:28 +0400
committerIgor Sysoev <igor@sysoev.ru>2008-06-20 18:48:28 +0400
commit0b5e77f41668a1e2f68fac9f9aca46f7193cd38d (patch)
tree19178ba7cf0a952e76a4dd12da6d57fc6a4ee6a9 /src
parentebc507bc78558433f1ffe21fce18c6adf8a2e040 (diff)
auto detect https redirect in rewrite
Diffstat (limited to 'src')
-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 9c3d3fb28..7192d3535 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;