Server_name & redirect

Hi,

I would like to have multiple domains on nginx to manage images. If one
image is not available, I redirect to a php processing the image. On the
next call the image will be available.

My conf looks like this:

server {
listen 80;
server_name img.domain1.com img.domain2.com img.domain3.com

and this something like this:

if (! -f $myimagefile) {

rewrite /process.php?param=some_parameters redirect;
break;

}

My problem is if I call img.domain2.com and if the image is not there,
I’am redirected to img.domain1.com/process.php
instead of domain2.com/process.php

The first domaine behind “server_name”. Is there a solution for that, or
a work around?

Thanks a lot.

Christophe

On Fri, Jul 25, 2008 at 06:21:31PM +0200, Christophe de Kerviler wrote:

instead of domain2.com/process.php

The first domaine behind “server_name”. Is there a solution for that, or
a work around?

If you use 0.6.25+, then you need to set

server_name_in_redirect off;

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs