# Error\_page

**URL:** <https://www.ruby-forum.com/t/error-page/205050>\
**Category:** NGINX\
**Created:** [March 28, 2011, 2:16pm UTC](https://www.ruby-forum.com/t/error-page/205050 "2011-03-28T14:16:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 28, 2011, 2:16pm UTC](https://www.ruby-forum.com/t/error-page/205050/1 "2011-03-28T14:16:21Z")

</div>

I just noticed that the error\_page directive strips post data… I  
thought a  
patch was submitted for this years ago?

Any chance of getting this patched? Us people using dynamic sites where  
we  
use internal redirects like: /index.php?page=$uri  
would apreciate it.

SplitIce

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 28, 2011, 4:59pm UTC](https://www.ruby-forum.com/t/error-page/205050/2 "2011-03-28T16:59:30Z")

</div>

Your should not be using error pages for creating clean URLs, they are  
for errors, nothing else. See this feature for making clean URLs:  
[http://wiki.nginx.org/NginxHttpCoreModule#try\_files](http://wiki.nginx.org/NginxHttpCoreModule#try_files)

Posted at Nginx Forum:

> **[Re: error\_page](https://forum.nginx.org/read.php?2,186315,186346#msg-186346)**
>
> I just noticed that the error\_page directive strips post data... I thought a patch was submitted for this years ago? Any chance of getting this patched? Us people using dynamic sites where we use internal redirects like: /index.php?page=$uri would...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 28, 2011, 7:56pm UTC](https://www.ruby-forum.com/t/error-page/205050/3 "2011-03-28T19:56:41Z")

</div>

On Mon, Mar 28, 2011 at 11:16:00PM +1100, SplitIce wrote:

Hi there,

> I just noticed that the error\_page directive strips post data… I thought a  
> patch was submitted for this years ago?

As currently implemented, if the error\_page value starts with a /,  
then the internal request for it is a GET (or HEAD).

The post\_data is provided as part of the request, but the receiving side  
probably won’t do much useful with it.

If the error\_page value starts with a @, the internal request matches  
the original one.

(Any other error\_page value results no internal request, which is  
probably not what you want.)

> Any chance of getting this patched? Us people using dynamic sites where we  
> use internal redirects like: /index.php?page=$uri  
> would apreciate it.

As per [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpCoreModule#error_page), you might find  
that something like

error\_page 404 = @index;  
location @index {  
include fastcgi\_params;  
fastcgi\_param SCRIPT\_FILENAME $document\_root/index.php;  
fastcgi\_pass unix:php.sock;  
}

does, or can be adapted to do, what you want. But test all the cases  
you care about before deploying 😉

Good luck with it,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
