# Error message control when using nginx as proxy

**URL:** <https://www.ruby-forum.com/t/error-message-control-when-using-nginx-as-proxy/207598>\
**Category:** NGINX\
**Created:** [May 29, 2011, 4:29pm UTC](https://www.ruby-forum.com/t/error-message-control-when-using-nginx-as-proxy/207598 "2011-05-29T16:29:28Z")\
**Posts on this page:** 1\
**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:** [May 29, 2011, 4:29pm UTC](https://www.ruby-forum.com/t/error-message-control-when-using-nginx-as-proxy/207598/1 "2011-05-29T16:29:28Z")

</div>

I have setup nginx as a front proxy, it passes php requests to Apache.

When I now try to access my site through, say, “TRACE”, then naturally I  
see the 405 error. But this is a nginx default message. How can I make  
sure that I see my own customized error page?

I have this in my “Server” definition…

#================================

# Custom error page…

#================================  
error\_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415  
416 417 495 496 497  
500 501 502 503 504 505 506 507 /error.htm;

But this does not seem to be working. For the 405, it still shows the  
default nginx page. Anything I can do about this?

Secondly, for Apache, there is still some mod\_security stuff that sends  
back a “406”. How can I make sure that Apache sending that signal back  
to Nginx only triggers the 406 I have setup in nginx?

Thanks!

Posted at Nginx Forum:

> **[Error message control when using nginx as proxy..](https://forum.nginx.org/read.php?2,201978,201978#msg-201978)**
>
> I have setup nginx as a front proxy, it passes php requests to Apache. When I now try to access my site through, say, "TRACE", then naturally I see the 405 error. But this is a nginx default message. How can I make sure that I see my own...
