rewrite two www domains to same non-www domain on nginx
I have added two domains to my droplet (domain1.com and domain2.com)
I want to rewrite both www and non-www to domain1.com i.e.:
It feels like I have tried every combination of server blocks in nginx but I cannot get it to work properly.
nginx version: nginx/1.4.6 (Ubuntu)
How do I set this up?