How do I get nginx to serve the "www." version of

October 27, 2014 4.1k views

Hello everyone,

I downloaded a LEMP stack onto my server and I have gotten nginx to serve, but for the life of me I cannot figure out how to get nginx to serve

Here is what the code looks like currently:

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /usr/share/nginx/html;
        index index.php index.html index.htm;


        location / {
                try_files $uri $uri/ =404;

What change can I make to get to work?

2 Answers

You did not setup DNS correctly. Fix the A record for

Have another answer? Share your knowledge.