'Redirect a user from www.abcd.in to www.abcd.com with nginx and django app automatically

I have a unique query:

There is a website is hosted on Digitalocean Droplet with a certain IP.

There is a abcd.com domain and a abcd.in domain.

Currently the nginx vhost is containing the abcd.com domain ServerName with the IP of the droplet. Also both abcd.com and abcd.in have the same IP addresses configured by the previous server admin.

I want a way such that when I open up abcd.in domain, it should redirect to abcd.com automatically.

What is the change required to be done in the Nginx server block for the same ? Or can I change directly on digitalocean itself in it's Domain Configuration.

The base stack is Django App with Python Stack.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source