Add www to domain

May 6, 2014 3.8k views
I have Ghost 0.4.2 set up on However, when you enter, you are still presented with the same general page. None of my links work with that, though, because I have Ghost configured to use www before the URL. I tried adding a cname with www pointing to @, but that didn't work. Then I added an A record with www pointing to my server's IP address. That didn't work either. Does anyone know of a way to force prepend www to the domain?
3 Answers
You can force a redirect to www by editing the nginx configuration like so:

server {
listen 80;
return 301$request_uri;
server {
listen 80;
server_name ;

client_max_body_size 10M;

location / {
proxy_pass http://localhost:2368/;
proxy_set_header Host $host;
proxy_buffering off;

This is found in:


Let us know how it goes!
Worked perfect, Andrew. One more thing: should I remove any of the records I added in DNS settings?
Glad it worked!

No, you should keep DNS records pointing both and to that IP address.
Have another answer? Share your knowledge.