mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
redirect - custom status code
This commit is contained in:
parent
ee5397df55
commit
38ab5ea21a
2 changed files with 12 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
{% if REDIRECT_TO != "" +%}
|
||||
{% if REDIRECT_TO_REQUEST_URI == "yes" +%}
|
||||
return 301 {{ REDIRECT_TO }}$request_uri;
|
||||
return {{ REDIRECT_TO_STATUS_CODE }} {{ REDIRECT_TO }}$request_uri;
|
||||
{% else +%}
|
||||
return 301 {{ REDIRECT_TO }};
|
||||
return {{ REDIRECT_TO_STATUS_CODE }} {{ REDIRECT_TO }};
|
||||
{% endif %}
|
||||
{% endif %}
|
|
@ -22,6 +22,16 @@
|
|||
"label": "Append request URI",
|
||||
"regex": "^(yes|no)$",
|
||||
"type": "check"
|
||||
},
|
||||
"REDIRECT_TO_STATUS_CODE": {
|
||||
"context": "multisite",
|
||||
"default": "301",
|
||||
"help": "Status code to send to client when redirecting.",
|
||||
"id": "redirect-to-status-code",
|
||||
"label": "Append request URI",
|
||||
"regex": "^(301|302)$",
|
||||
"type": "select",
|
||||
"select": ["301", "302"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue