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?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×