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

**URL:** <https://www.ruby-forum.com/t/is-there-anyway-to-customize-the-error-msg-for-a-error-code/208588>\
**Category:** NGINX\
**Created:** [June 22, 2011, 5:35am UTC](https://www.ruby-forum.com/t/is-there-anyway-to-customize-the-error-msg-for-a-error-code/208588 "2011-06-22T05:35:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [June 22, 2011, 5:35am UTC](https://www.ruby-forum.com/t/is-there-anyway-to-customize-the-error-msg-for-a-error-code/208588/1 "2011-06-22T05:35:40Z")

</div>

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:

> **[Is there anyway to customize the error msg for a error code?](https://forum.nginx.org/read.php?2,208911,208911#msg-208911)**
>
> 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.

---

<div class="post-metadata">

**Author:** ![speedfirst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@speedfirst](https://www.ruby-forum.com/u/speedfirst)\
**Post date:** [June 22, 2011, 7:29am UTC](https://www.ruby-forum.com/t/is-there-anyway-to-customize-the-error-msg-for-a-error-code/208588/2 "2011-06-22T07:29:12Z")

</div>

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:

> **[Re: Is there anyway to customize the error msg for a error code?](https://forum.nginx.org/read.php?2,208911,208918#msg-208918)**
>
> 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.

---

<div class="post-metadata">

**Author:** ![speedfirst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@speedfirst](https://www.ruby-forum.com/u/speedfirst)\
**Post date:** [June 22, 2011, 3:24pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-customize-the-error-msg-for-a-error-code/208588/3 "2011-06-22T15:24:00Z")

</div>

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:

> **[Re: Is there anyway to customize the error msg for a error code?](https://forum.nginx.org/read.php?2,208911,209036#msg-209036)**
>
> 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.
