# Change in error\_page behavior

**URL:** <https://www.ruby-forum.com/t/change-in-error-page-behavior/198458>\
**Category:** NGINX\
**Created:** [November 1, 2010, 7:23pm UTC](https://www.ruby-forum.com/t/change-in-error-page-behavior/198458 "2010-11-01T19:23:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [November 1, 2010, 7:23pm UTC](https://www.ruby-forum.com/t/change-in-error-page-behavior/198458/1 "2010-11-01T19:23:03Z")

</div>

I used to use this:

&nbsp;&nbsp;error\_page 497 https://domain.com:7878$request\_uri;

to redirect requests from the [http://domain.com:7878](http://domain.com:7878) non-ssl address to  
the ssl version on the same port. see  
[Http-\>https redirection on the same port - NGINX - Ruby-Forum](http://www.ruby-forum.com/topic/156683)

This stopped working recently, probably with the latest change to  
error\_page in 0.8.53.

After some trial and error, it seems to be working fine with this:

&nbsp;&nbsp;error\_page 497 =301 https://domain.com:7878$request\_uri;

Is that going to give me the same effect as before?

Posted at Nginx Forum:

> **[Change in error\_page behavior](https://forum.nginx.org/read.php?2,146624,146624#msg-146624)**
>
> I used to use this: &nbsp;&nbsp;error\_page 497 https://domain.com:7878$request\_uri; to redirect requests from the http://domain.com:7878 non-ssl address to the ssl version on the same port. see http://www.ruby-forum.com/topic/156683 This...

---

<div class="post-metadata">

**Author:** ![brianmercer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@brianmercer](https://www.ruby-forum.com/u/brianmercer)\
**Post date:** [November 1, 2010, 11:07pm UTC](https://www.ruby-forum.com/t/change-in-error-page-behavior/198458/2 "2010-11-01T23:07:03Z")

</div>

Hello!

On Mon, Nov 01, 2010 at 02:20:56PM -0400, brianmercer wrote:

> I used to use this:
> 
> &nbsp;&nbsp;error\_page 497 https://domain.com:7878$request\_uri;
> 
> to redirect requests from the [http://domain.com:7878](http://domain.com:7878) non-ssl address to  
> the ssl version on the same port. see  
> [Http-\>https redirection on the same port - NGINX - Ruby-Forum](http://www.ruby-forum.com/topic/156683)
> 
> This stopped working recently, probably with the latest change to  
> error\_page in 0.8.53.

Yes, thank you for your report. It’s indeed broken in 0.8.53.

I’m currently working on a patch for another problem introduced by  
the same change, it should fix your problem as well.

> After some trial and error, it seems to be working fine with this:
> 
> &nbsp;&nbsp;error\_page 497 =301 https://domain.com:7878$request\_uri;
> 
> Is that going to give me the same effect as before?

If you want to achieve exactly the same effect as before you  
should use =302. Though =301 is probably better here.

Maxim D.

---

<div class="post-metadata">

**Author:** ![brianmercer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@brianmercer](https://www.ruby-forum.com/u/brianmercer)\
**Post date:** [November 2, 2010, 5:06am UTC](https://www.ruby-forum.com/t/change-in-error-page-behavior/198458/3 "2010-11-02T05:06:12Z")

</div>

Hello!

On Tue, Nov 02, 2010 at 01:05:42AM +0300, Maxim D. wrote:

> > [Http-\>https redirection on the same port - NGINX - Ruby-Forum](http://www.ruby-forum.com/topic/156683)
> > 
> > This stopped working recently, probably with the latest change to  
> > error\_page in 0.8.53.
> 
> Yes, thank you for your report. It’s indeed broken in 0.8.53.
> 
> I’m currently working on a patch for another problem introduced by  
> the same change, it should fix your problem as well.

Patch:

> **[\[PATCH 2 of 5\] Fix error\_page status code change in redirect](http://mailman.nginx.org/pipermail/nginx-devel/2010-November/000537.html)**

Maxim D.
