If file not found redirect to proxy

hi,

I am using nginx to serve static files and proxying to jetty for dynamic
pages.

What I generally do is build the .war file, put it on jetty and also put
the
static files on nginx for nginx to serve.

Now, can I do this, if some static file is not present in nginx, it will
ask
the jetty server for this file?

I tried to proxy to jetty server if the requested file is not present,
but
it is not allowing me to put the proxy_pass line inside the
if(filenotfound)
block.

Is there any other way to achieve that.

Thanks,
Rakesh.

Thanks, that did the job.

Hello just,

Monday, February 18, 2008, 2:48:29 PM, you wrote:

hi,

I am using nginx to serve static files and proxying to jetty for dynamic
pages.

What I generally do is build the .war file, put it on jetty and also put the
static files on nginx for nginx to serve.

Now, can I do this, if some static file is not present in nginx, it will ask
the jetty server for this file?

I tried to proxy to jetty server if the requested file is not present, but
it is not allowing me to put the proxy_pass line inside the if(filenotfound)
block.

Is there any other way to achieve that.

location / {
error_page 404 = @backend;
}

location @backend {
proxy_pass …;
}