Welcome! Log In Create A New Profile

Advanced

Error pages with images

Posted by toddholmberg 
Error pages with images
August 16, 2012 04:00PM
Hello,

I would like to display a company logo on my error pages. I have working custom error pages. I would like to be able to serve images on the error pages from an /images directory in the root of the named locations. Currently, any requests to a relative URL(src="/images/image_name.jpeg") returns a 404. Any help with this would be greatly appreciated.

Here are the relevant lines from my config:

location ~ \.php$ {

fastcgi_pass php;
include /etc/nginx/fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_parddam SCRIPT_FILENAME $document_root$fastcgi_script_name;

error_page 404 403 @40x;
error_page 500 502 503 504 @50x;

}

location @40x {
internal;
root /usr/share/nginx/html;
rewrite ^ /40x.html break;
}

location @50x {
internal;
root /usr/share/nginx/html;
rewrite ^ /50x.html break;
}


Thank you,

Todd Holmberg
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 209
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready