Welcome! Log In Create A New Profile

Advanced

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

Posted by levchick 
how to check destination url response code is 200 before redirecting with nginx
November 16, 2016 07:16AM
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.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready