Rewrite issues

Victor Iggy lists at ruby-forum.com
Mon Jun 9 23:29:37 MSD 2008


Victor Iggy wrote:
> I am trying to redirect users to an upgrade page when there is an
> "upgrade" file in the location block location. However it seems that it
> is not picking up on it.
> 
> Here is the configuration.
> location / {
>   if (-f upgrade) {
>                 rewrite ^(.*)
> http://media.fabulously40.com/upgrading.html last;
>  }
> ... redirect to proxy configuration below ...
> }
> 
> This should work no? if "upgrade" file exists rewrite the request.
> 
> Am I missing something here...
> 
> -Victor

Okay I figured it out, needed to add break;

        if (-f /opt/jetty/production/fab40/upgrade) {
                rewrite ^(.*)$ /html/upgrade.html last;
                break;
        }

And I added the full path name for good measure.
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list