If file not found redirect to proxy...

Denis F. Latypoff denis at gostats.ru
Mon Feb 18 12:01:09 MSK 2008

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 ...;

> Thanks,
> Rakesh.

Best regards,
 Denis                            mailto:denis at gostats.ru

More information about the nginx mailing list