I am editing nginx.conf. I want to redirect all pages of domain1.com to domain2.com.
How to edit the file to make it work.
I see a line:
if($http_host != domain1.com){
rewrite (.*) https://domain1.com$1 permanent;
}
if I change it to ‘=’ in the if statement and rewrite to the new domain, will it work or I need to make sure other things to change.
Example:
if($http_host = domain1.com){
reqrite (.*) https://domain2.com$1 permanent;
}