D
D
Denis2011-03-24 16:20:01
Nginx
Denis, 2011-03-24 16:20:01

redirect to nginx

Hello.
It is necessary to implement the following: when a certain page is requested, nginx pulls the script. If the script fails (due to an error, timeout, or any other reason, it didn't work as it should), nginx should return some other page.

Any ideas?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
IlVin, 2011-03-24
@IlVin

You need to use a named location:
location… {
error_page 404 502 504 = @errorlocation;
}
location @errorlocation {
}
Documentation:
sysoev.ru/nginx/docs/http/ngx_http_core_module.html#location

J
justabaka, 2011-03-24
@justabaka

I think it's worth looking in the direction of pages for 500 errors.

D
Denis, 2011-03-24
@uscr

Thank you. I'm already starting to tinker.

Z
zizop, 2011-03-24
@zizop

Here is a small example on named locations .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question