Nginx Reg ex for server name

I have an nginx config to match the host name as below

 server_name                  ~^(.*\.pamz\.govt\.nz)|(.*(\.wealthcare\.usa\.govt\.nz)|[\d]*\.[\d]*\.[\d]*\.[\d]*)$;

But wanted to exclude abcui.pamz.govt.nz from the above config.
Not sure how can i do that as whatever i try it keeps failing.

Can someone please help me on how do I exclude specifically the abcui from it.

I cannot say what other server names we have that is already being used

All i know is api.pamz.govt.nz but there are other ones as well which i dont know so avoiding to change for the existing ones. So only my new host abcui.pamz.govt.nz should be filtered out from the above server_name regex

Read more here: Source link