summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_special_response.c
diff options
context:
space:
mode:
authorSimon Leblanc <contact@leblanc-simon.eu>2017-04-11 03:13:46 +0200
committerSimon Leblanc <contact@leblanc-simon.eu>2017-04-11 03:13:46 +0200
commit8ee2de5e9c930273c99a03452e7336f8a393ec42 (patch)
treed26de384b0f3a2d6533d9823cb5087d230954287 /src/http/ngx_http_special_response.c
parenta965e1d76642095f3f4e5f43d13a8b0379296e43 (diff)
downloadnginx-8ee2de5e9c930273c99a03452e7336f8a393ec42.tar.gz
nginx-8ee2de5e9c930273c99a03452e7336f8a393ec42.tar.bz2
Added support for the "308 Permanent Redirect" (ticket #877).
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r--src/http/ngx_http_special_response.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index c9b101727..c4c13053b 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -89,6 +89,14 @@ static char ngx_http_error_307_page[] =
;
+static char ngx_http_error_308_page[] =
+"<html>" CRLF
+"<head><title>308 Permanent Redirect</title></head>" CRLF
+"<body bgcolor=\"white\">" CRLF
+"<center><h1>308 Permanent Redirect</h1></center>" CRLF
+;
+
+
static char ngx_http_error_400_page[] =
"<html>" CRLF
"<head><title>400 Bad Request</title></head>" CRLF
@@ -336,8 +344,9 @@ static ngx_str_t ngx_http_error_pages[] = {
ngx_null_string, /* 305 */
ngx_null_string, /* 306 */
ngx_string(ngx_http_error_307_page),
+ ngx_string(ngx_http_error_308_page),
-#define NGX_HTTP_LAST_3XX 308
+#define NGX_HTTP_LAST_3XX 309
#define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX)
ngx_string(ngx_http_error_400_page),
@@ -615,7 +624,8 @@ ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
if (overwrite != NGX_HTTP_MOVED_PERMANENTLY
&& overwrite != NGX_HTTP_MOVED_TEMPORARILY
&& overwrite != NGX_HTTP_SEE_OTHER
- && overwrite != NGX_HTTP_TEMPORARY_REDIRECT)
+ && overwrite != NGX_HTTP_TEMPORARY_REDIRECT
+ && overwrite != NGX_HTTP_PERMANENT_REDIRECT)
{
r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
}