301 redirect with Nginx? Server_name is localhost
Probably an obvious question, but I’m new to this stuff…
I’m trying to use a 301 redirect to get www.ourapp.com to resolve to ourapp.com - currently, a user can open two different sessions on www and non-www, which we’d like to prevent. I found this very helpful Stackoverflow post: http://stackoverflow.com/questions/7947030/nginx-no-www-to-www-and-www-to-no-www
But when I open up my default file in etc/nginx/sites-available, the server_name is localhost, not ourapp.com. How do I deal with this situation?
Any help greatly appreciated.