Hello there
I'm running nginx/0.7.62 on a Ubuntu box.
We've recently changed domain names.
I've got 2 wildcard DNS entries setup pointing at the server
*.subdomain.domainA.com and *.subdomain.domainB.com
I can't quite figure out how to redirect all the traffic from *.subdomain.domainA.com to *.subdomain.domainB.com whilst passing the same value for * onto the new redirect.
Can someone tell me whats wrong with the following code?
server {
listen 80;
server_name ~^(\w+)\.subdomain\.domainA\.com$;
location / {
rewrite ^(.*) http://$1.subdomain.domainB.com$request_uri permanent;
}
}
It currently redirects anything.subdomain.domainA.com to .subdomain.domainB.com
So that suggests (\w+) is not being described by $1. I think I've got a mixture of different versions syntax going on.
Any help, as always, greatly appreciated.
I'm running nginx/0.7.62 on a Ubuntu box.
We've recently changed domain names.
I've got 2 wildcard DNS entries setup pointing at the server
*.subdomain.domainA.com and *.subdomain.domainB.com
I can't quite figure out how to redirect all the traffic from *.subdomain.domainA.com to *.subdomain.domainB.com whilst passing the same value for * onto the new redirect.
Can someone tell me whats wrong with the following code?
server {
listen 80;
server_name ~^(\w+)\.subdomain\.domainA\.com$;
location / {
rewrite ^(.*) http://$1.subdomain.domainB.com$request_uri permanent;
}
}
It currently redirects anything.subdomain.domainA.com to .subdomain.domainB.com
So that suggests (\w+) is not being described by $1. I think I've got a mixture of different versions syntax going on.
Any help, as always, greatly appreciated.