0

How does nginx figure I have a conflicting server name?

[warn] conflicting server name "" on 0.0.0.0:80, ignored nginx.

I wouldn't care, except it only seems to be serving files from project.ca and completely ignores projectfinancial.com...

server {
        root /var/www/project/infrastructure/project/static-sites/projectlabswebsite;
        index index.html
        server_name projectfinancial.com *.projectfinancial.com;
        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to index.html
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }
}

server {
        root /var/www/project/infrastructure/project/static-sites/project-website;
        index index.html
        server_name project.ca *.project.ca;
        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to index.html
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }
}

1 Answer 1

1

The answer is:

There is a missing semi colon after index index.html

And for those interested, you can set server_name to .project.ca instead of project.ca *.project.ca as they are both the same.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.