V
V
VladislavRamirez2020-10-05 13:32:34
Nginx
VladislavRamirez, 2020-10-05 13:32:34

Capturing Apache + Nginx errors?

There is a bunch of apache + nginx. nginx as a proxy. how to implement error trapping with nginx?
for example, Apache gives a 404 error that the directory is not found, nginx picks up the error and sends its default 404 page to the browser

in the direction of proxy_intercept_errors on, but for some reason it doesn’t work

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2020-10-05
@shambler81

404 must be processed by the CMS engine, at least it must return the site header footer, and the 404 itself. actually how it should work
1. nginx - sees 404
2. therefore this error is processed by a separate location giving 404 to apache, maybe it will be able to find the file or execute with other code.
3. it does not find it and the site engine gives 404.
the only way.

K
ky0, 2020-10-05
@ky0

Yes, dig towards proxy_intercept_errors .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question