diff --git a/src/common/core/redirect/confs/server-http/redirect.conf b/src/common/core/redirect/confs/server-http/redirect.conf index 3323580eb..5ba2206de 100644 --- a/src/common/core/redirect/confs/server-http/redirect.conf +++ b/src/common/core/redirect/confs/server-http/redirect.conf @@ -1,7 +1,9 @@ {% if REDIRECT_TO != "" +%} - {% if REDIRECT_TO_REQUEST_URI == "yes" +%} -return {{ REDIRECT_TO_STATUS_CODE }} {{ REDIRECT_TO }}$request_uri; - {% else +%} -return {{ REDIRECT_TO_STATUS_CODE }} {{ REDIRECT_TO }}; - {% endif %} + location / { + {% if REDIRECT_TO_REQUEST_URI == "yes" +%} + return {{ REDIRECT_TO_STATUS_CODE }} {{ REDIRECT_TO }}$request_uri; + {% else +%} + return {{ REDIRECT_TO_STATUS_CODE }} {{ REDIRECT_TO }}; + {% endif %} + } {% endif %}