mirror of
https://github.com/nginx/nginx.git
synced 2024-12-20 14:13:33 -06:00
autodetect redirect if URI is rewritten to a string starting with $scheme
This commit is contained in:
parent
f5f4126574
commit
1a26a18f64
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user