Problem add http_400 for module upstream
haonhien
nginx-forum at nginx.us
Fri Apr 6 09:15:23 UTC 2012
Hello every body!
I want to add http_400 in directive proxy_next_upstream of module
upstream:
1. Add code below in file src/http/ngx_http_upstream.h:
#define NGX_HTTP_UPSTREAM_FT_HTTP_502 0x00000020
#define NGX_HTTP_UPSTREAM_FT_HTTP_503 0x00000040
#define NGX_HTTP_UPSTREAM_FT_HTTP_504 0x00000080
#define NGX_HTTP_UPSTREAM_FT_HTTP_404 0x00000100
#define NGX_HTTP_UPSTREAM_FT_HTTP_400 0x00000120 //---> not
right
2.Add code below in file ngx_http_upstream.c:
{ 500, NGX_HTTP_UPSTREAM_FT_HTTP_500 },
{ 502, NGX_HTTP_UPSTREAM_FT_HTTP_502 },
{ 503, NGX_HTTP_UPSTREAM_FT_HTTP_503 },
{ 504, NGX_HTTP_UPSTREAM_FT_HTTP_504 },
{ 404, NGX_HTTP_UPSTREAM_FT_HTTP_404 },
{ 400, NGX_HTTP_UPSTREAM_FT_HTTP_400 }, //add code here
3.Add code below in file src/http/modules/ngx_http_proxy_module.c:
{ ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 },
{ ngx_string("http_502"), NGX_HTTP_UPSTREAM_FT_HTTP_502 },
{ ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
{ ngx_string("http_504"), NGX_HTTP_UPSTREAM_FT_HTTP_504 },
{ ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
{ ngx_string("http_400"), NGX_HTTP_UPSTREAM_FT_HTTP_400 }, // add
code here
Plz help me
Thank you so much.
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225010,225010#msg-225010
More information about the nginx
mailing list