Hello,
I have a web application that has had a name change. Im trying to figure out how to create a rewrite rule that forwards the users to the new domain for their account.
Example.
customer1.cloud.company.com -> customer1.company.cloud
We have many customers with their own domains setup. Below is what i've tried as a rewrite rule that doesn't seem to work.
Code:
server_name ~^(\w+)\.cloud.company\.com$;
return 301 $scheme://$1.company.cloud$request_uri;
When i try to visit the site i get redirected to ".company.cloud" seems as though the sub domain is being stripped out.
Thanks!