Question

nginx - keeping default page with other websites on server ip

Hello all, Using ubuntu 12.04 + varnish + nginx +apc I have been able to correctly set up multiple websites, but when I try to add default ip page (welcome to nginx), it breaks something, i mean either it takes example1.com or others to default page ,

When i remove it(default server block), everything works except when i open ip it takes me to 1 of my domain. So my question is it compulsory to remove that block? I want my server ip to show nginx default page,

primarily to ensure no ip canonicalization, I have added all blocks in single default file so is that symbolic link also required each time for every domain added? (sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/wordpress) because mine are working without adding that link, except the default added already.

Also is it better to create different file for every server block or one file is good to go? Thanks


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

ok, <br>found the problem, <br>hadn’t added server block for www. <br>thanks