Error_page on 0.5.35

I have this under http in my nginx.conf file:
error_page 404 /var/www/apps/myapp/templates/404.html;
error_page 502 503 504 /var/www/apps/myapp/templates/500.html;

I can access these at myapp.com/500.html and 应用宝官网-全网最新最热手机应用游戏下载 but when
I
get a 502 gateway error instead of displaying the 500.html page I get
the
default nginx page. Any suggestions?

Best,
Jamie

On Thu, Feb 21, 2008 at 12:51:31AM -0800, Jamie Q. wrote:

I have this under http in my nginx.conf file:
error_page 404 /var/www/apps/myapp/templates/404.html;
error_page 502 503 504 /var/www/apps/myapp/templates/500.html;

I can access these at 应用宝官网-全网最新最热手机应用游戏下载 and 应用宝官网-全网最新最热手机应用游戏下载 but when I
get a 502 gateway error instead of displaying the 500.html page I get the
default nginx page. Any suggestions?

Do you have any error_page directives at server or location levels ?
They override http level error_page’s.

On Thursday 21 February 2008, Jamie Q. wrote:

I have this under http in my nginx.conf file:
error_page 404 /var/www/apps/myapp/templates/404.html;
error_page 502 503 504 /var/www/apps/myapp/templates/500.html;

I can access these at 应用宝官网-全网最新最热手机应用游戏下载 and 应用宝官网-全网最新最热手机应用游戏下载 but when I
get a 502 gateway error instead of displaying the 500.html page I get the
default nginx page. Any suggestions?

you should specify URI or URL, but not full path

error_page 404 /404.html;
error_page 502 503 504 /500.html;

Igor: I do not, I only have those two.
Roxis: I cant do this easily since I can’t use a location directive
because
this is at the http level rather than the server level.

On Thursday 21 February 2008, Jamie Q. wrote:

I cant do this easily since I can’t use a location directive because
this is at the http level rather than the server level.

Create a file with this configuration:

location = /404.html {
root /var/www/apps/myapp/templates;
}

location = /500.html {
root /var/www/apps/myapp/templates;
}

and include it in every server directory

On Thu, Feb 21, 2008 at 01:32:43AM -0800, Jamie Q. wrote:

Igor: I do not, I only have those two.
Roxis: I cant do this easily since I can’t use a location directive because
this is at the http level rather than the server level.

Roxis is right: you should set URI, but not file path.

http {

 error_page    404         /404.html;
 error_page    502 503 504 /500.html;

 server {

     location = /404.html { root  /var/www/apps/myapp/templates; }
     location = /500.html { root  /var/www/apps/myapp/templates; }

I’ll do that, thanks.
I almost did it that way initially but was trying to avoid the
duplication
:slight_smile:

Best,
Jamie