Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

how to check destination url response code is 200 before redirecting with nginx

$
0
0
I have two domain names, for example domain1.com and domain1.org. All requests from domain1.com are redirected to domain1.org, with uri of course. How can I check with nginx that uri on domain1.org returns 200 response code and only after this do redirect. If the code will be 404 or another just return this code from domain1.com without any redirect.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>