nginx redirecting to localhost

Solution 1:

Change

server_name  localhost;

to

server_name  your.domain.com;

Solution 2:

You'll need the above answer plus

server_name_in_redirect off;

Then clear your browser cache