Answer the question
In order to leave comments, you need to log in
How to make nginx page_error multilingual?
Hello!
Can someone tell me how to make error_page multilingual?
There are 2 html not_access_en.html and not_access_ru.html. When the stub (error_page 503) is set, then not_access_en.html - this page has a language switcher, but when I try to switch to another language on the page, nothing happens. How can I make html pages switch?
https://habr.com/ru/post/139968/ did by analogy.
Answer the question
In order to leave comments, you need to log in
You went the wrong way in the first place.
Response codes should not be given by nignx,
but they should be given by cms itself
, they have all this, up to the 404 template.
However, if the 50X error is really backing, it may not respond in principle, and then it would not be sour to immediately give a beautiful page.
Nobody bothers you to send it to a PHP file, which, in turn, will connect the geolocator, which, in turn, will substitute the template.
cheap and cheerful and works.
If nginx+fpm doesn't work anymore, then there will be no one to give you 500.
error_page 500 502 503 = @fallback;
location @fallback {
тут правило че отдать, но сам саму логику уже в пхп или че там у вас
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question