Answer the question
In order to leave comments, you need to log in
How to check response code from redirect url when redirecting in nginx?
Good afternoon,
There are two domains domain.com and domain.org, at the moment all requests are redirected from com to org with the corresponding uri. Is it possible to check the response code from .org with such a uri before redirecting and if it is not 200, just return it without any redirects? It must be done using the nginx server. Thanks for answers.
Answer the question
In order to leave comments, you need to log in
As far as I know, this cannot be done with standard directives.
However, you can write a few lines in Lua - then everything will be wonderful.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question