Commit b88b7b9d authored by Marius Burkard's avatar Marius Burkard
Browse files

Merge branch 'fix-6144' into 'develop'

Ensure that we always have two capture groups in nginx redirect regex expressions

Closes #6144

See merge request ispconfig/ispconfig3!1468
parents c3479cdc afc1c2ec
......@@ -60,13 +60,13 @@ server {
</tmpl_loop>
<tmpl_loop name="local_redirects">
if ($http_host <tmpl_var name='local_redirect_operator'> "<tmpl_var name='local_redirect_origin_domain'>") {
rewrite ^<tmpl_var name='local_redirect_exclude'>(.*)$ <tmpl_var name='local_redirect_target'>$1 <tmpl_var name='local_redirect_type'>;
rewrite ^<tmpl_var name='local_redirect_exclude'>(.*)$ <tmpl_var name='local_redirect_target'>$2 <tmpl_var name='local_redirect_type'>;
}
</tmpl_loop>
<tmpl_loop name="own_redirects">
<tmpl_if name='use_rewrite'>
<tmpl_if name='exclude_own_hostname'>if ($http_host != "<tmpl_var name='exclude_own_hostname'>") { </tmpl_if>rewrite ^<tmpl_var name='rewrite_exclude'>(.*)$ <tmpl_var name='rewrite_target'>$1 <tmpl_var name='rewrite_type'>;<tmpl_if name='exclude_own_hostname'> }</tmpl_if>
<tmpl_if name='exclude_own_hostname'>if ($http_host != "<tmpl_var name='exclude_own_hostname'>") { </tmpl_if>rewrite ^<tmpl_var name='rewrite_exclude'>(.*)$ <tmpl_var name='rewrite_target'>$2 <tmpl_var name='rewrite_type'>;<tmpl_if name='exclude_own_hostname'> }</tmpl_if>
</tmpl_if>
<tmpl_if name='use_proxy'>
location / {
......
......@@ -1499,7 +1499,7 @@ class nginx_plugin {
}
} else {
// external URL
$rewrite_exclude = '(?!\.well-known/acme-challenge)/';
$rewrite_exclude = '(?!/(\.well-known/acme-challenge))/';
if($data['new']['redirect_type'] == 'proxy'){
$vhost_data['use_proxy'] = 'y';
$rewrite_subdir = $tmp_redirect_path_parts['path'];
......@@ -1551,7 +1551,7 @@ class nginx_plugin {
}
} else {
// external URL
$rewrite_exclude = '(?!\.well-known/acme-challenge)/';
$rewrite_exclude = '(?!/(\.well-known/acme-challenge))/';
if($data['new']['redirect_type'] == 'proxy'){
$vhost_data['use_proxy'] = 'y';
$rewrite_subdir = $tmp_redirect_path_parts['path'];
......@@ -1601,7 +1601,7 @@ class nginx_plugin {
}
} else {
// external URL
$rewrite_exclude = '(?!\.well-known/acme-challenge)/';
$rewrite_exclude = '(?!/(\.well-known/acme-challenge))/';
if($data['new']['redirect_type'] == 'proxy'){
$vhost_data['use_proxy'] = 'y';
$rewrite_subdir = $tmp_redirect_path_parts['path'];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment