Is there anyway to customize the error msg for a error code?

For example, 403’s msg is “Forbidden”. If there is someway to append
some customized msg to this HTTP response status line like:

HTTP/1.1 403 Forbiden, no id provided
Date: xxxx
Content-Type: text/html

Thanks.

Posted at Nginx Forum:

hi speedfirst,

     i dont know whether u can append or not. but you can redirect

the page u want to send if u get such errors

  for example

error_page  403   /response.html;

instead of getting 403 in the client response.html will be sent to
client . if U want to send alternate Response to client instead of
sending 403.

Posted at Nginx Forum:

Thanks for the reply.

What I mean is to change the short error msg after the error code in the
HTTP response status line, not the response HTML page. My motivation is
to keep nginx consistent with the upstream server. Although the error
code consistence is enough in the functionality, it would be better if
the short error msg can be changed by configuring or simply programming.

Posted at Nginx Forum: