]> git.kaiwu.me - nginx.git/commitdiff
Proxy authentication definitions.
authorRoman Arutyunyan <arut@nginx.com>
Tue, 10 Mar 2026 12:43:41 +0000 (16:43 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Wed, 11 Mar 2026 15:33:12 +0000 (19:33 +0400)
src/http/ngx_http_header_filter_module.c
src/http/ngx_http_request.c
src/http/ngx_http_request.h
src/http/ngx_http_special_response.c

index 789938329ece2c28721a870f7045758f02089187..15215c531b74f6642bc6faf3068d4c6e90b3fcae 100644 (file)
@@ -91,7 +91,7 @@ static ngx_str_t ngx_http_status_lines[] = {
     ngx_string("404 Not Found"),
     ngx_string("405 Not Allowed"),
     ngx_string("406 Not Acceptable"),
-    ngx_null_string,  /* "407 Proxy Authentication Required" */
+    ngx_string("407 Proxy Authentication Required"),
     ngx_string("408 Request Time-out"),
     ngx_string("409 Conflict"),
     ngx_string("410 Gone"),
index 41c1cda041a5f10bd01cae98822a38e32e13ea72..7305af132db1f289a3ed6a8ab7fe4aafea42ed98 100644 (file)
@@ -152,6 +152,10 @@ ngx_http_header_t  ngx_http_headers_in[] = {
                  offsetof(ngx_http_headers_in_t, authorization),
                  ngx_http_process_unique_header_line },
 
+    { ngx_string("Proxy-Authorization"),
+                 offsetof(ngx_http_headers_in_t, proxy_authorization),
+                 ngx_http_process_unique_header_line },
+
     { ngx_string("Keep-Alive"), offsetof(ngx_http_headers_in_t, keep_alive),
                  ngx_http_process_header_line },
 
index 1b012f8109aa102a34562a9204bcb7761d6db971..7a77498eb58ba57f3a6b7b261b30e7a82c0a5d20 100644 (file)
@@ -95,6 +95,7 @@
 #define NGX_HTTP_FORBIDDEN                 403
 #define NGX_HTTP_NOT_FOUND                 404
 #define NGX_HTTP_NOT_ALLOWED               405
+#define NGX_HTTP_PROXY_AUTH_REQUIRED       407
 #define NGX_HTTP_REQUEST_TIME_OUT          408
 #define NGX_HTTP_CONFLICT                  409
 #define NGX_HTTP_LENGTH_REQUIRED           411
@@ -210,6 +211,7 @@ typedef struct {
 #endif
 
     ngx_table_elt_t                  *authorization;
+    ngx_table_elt_t                  *proxy_authorization;
 
     ngx_table_elt_t                  *keep_alive;
 
@@ -273,6 +275,7 @@ typedef struct {
     ngx_table_elt_t                  *content_range;
     ngx_table_elt_t                  *accept_ranges;
     ngx_table_elt_t                  *www_authenticate;
+    ngx_table_elt_t                  *proxy_authenticate;
     ngx_table_elt_t                  *expires;
     ngx_table_elt_t                  *etag;
 
index eaf42e39911787d99400622c8617bdd2c7be69c1..2984ffe423c1122ec4bf05839e50f56be490c901 100644 (file)
@@ -153,6 +153,14 @@ static char ngx_http_error_406_page[] =
 ;
 
 
+static char ngx_http_error_407_page[] =
+"<html>" CRLF
+"<head><title>407 Proxy Authentication Required</title></head>" CRLF
+"<body>" CRLF
+"<center><h1>407 Proxy Authentication Required</h1></center>" CRLF
+;
+
+
 static char ngx_http_error_408_page[] =
 "<html>" CRLF
 "<head><title>408 Request Time-out</title></head>" CRLF
@@ -364,7 +372,7 @@ static ngx_str_t ngx_http_error_pages[] = {
     ngx_string(ngx_http_error_404_page),
     ngx_string(ngx_http_error_405_page),
     ngx_string(ngx_http_error_406_page),
-    ngx_null_string,                     /* 407 */
+    ngx_string(ngx_http_error_407_page),
     ngx_string(ngx_http_error_408_page),
     ngx_string(ngx_http_error_409_page),
     ngx_string(ngx_http_error_410_page),