I have as below in nginx but it doesn't do what I intend:
location / {
if ($host !~* blah.blah.com) {
return 307 https://$host/$request?uri;
}
}
I basically need to do a 307 when $host doesn't match blah.blah.com in regex or it could really just be a plain string. I tried putting them in double quotes or /.../ but nothing seems to work. How do I specify this in nginx's location block?