smart proxy: do not redirect when given argument

?redirect=false
This commit is contained in:
Iain Learmonth 2022-08-15 10:13:44 +01:00
parent 2823033e67
commit 5db44e68e9

View file

@ -186,6 +186,12 @@ class ProxyAutomation(TerraformAutomation):
listen 443 ssl; listen 443 ssl;
server_name origin-{{ origin.id }}.{{ provider }}.smart.{{ smart_zone[:-1] }}; server_name origin-{{ origin.id }}.{{ provider }}.smart.{{ smart_zone[:-1] }};
if ($redirect_country = yes) { if ($redirect_country = yes) {
set $redirect_test 1;
}
if ($arg_redirect = "false") {
set $redirect_test 0;
}
if ($redirect_test = 1) {
rewrite ^ https://{{ origin.domain_name }}$request_uri? break; rewrite ^ https://{{ origin.domain_name }}$request_uri? break;
} }
location / { location / {