I want to redirect requests on two conditions using nginx.
This doesn\'t work:
if ($host = \'domain.com\' || $host = \'domain2.com\'){ rewrite ^/(
I think the easiest way to do it it's just use regular expression:
if ($host ~ "domain.com|domain2.com") { rewrite ^/(.*)$ http://www.example.com/$1 permanent; }
But it's good only when you have only strings; for complex logic, sure, it is not correct.