Rewrite rule for nginx image?

Igor Sysoev is at rambler-co.ru
Mon Jan 7 11:02:23 MSK 2008


On Sun, Jan 06, 2008 at 07:14:20PM -0500, Floren Munteanu wrote:

> Igor, what I try to do is this:
> When someone visits a missing page, he/she is pointed to a 404 custom page.
> Example:
> http://69.156.32.106/tester/
> 
> Look at the image, it is not showing. Is there a way to properly display the
> nginx.gif image, using a condition defined into the server config file?

You should set abosolute pathes for nginx.gif and favicon.ico in the page:

-     nginx.gif
+     /nginx.gif
-     favicon.ico
+     /favicon.ico

> Thanks.
> 
> -----Original Message-----
> From: owner-nginx at sysoev.ru [mailto:owner-nginx at sysoev.ru] On Behalf Of Igor
> Sysoev
> Sent: Sunday, January 06, 2008 2:30 PM
> To: nginx at sysoev.ru
> Subject: Re: Rewrite rule for nginx image?
> 
> On Sun, Jan 06, 2008 at 02:11:48PM -0500, Floren Munteanu wrote:
> 
> > I have a small image that I've downloaded from nginx.net and use it a logo
> > for the 404 pages.
> > What would be the code I need to insert into nginx.conf, in order to
> > automatically point the image location to a specific path or URL?
> 
> I do not understand your question, but probably:
> 
>         location = /logo.gif {
>             root  /path/to;
> 
>             # or
>             #alias  /path/to/logo.gif;
>         }
> 
> 
> -- 
> Igor Sysoev
> http://sysoev.ru/en/
> 
> 

-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list