Server Name: Ip or domain (Nginx Server Block )

Hi all! I’m using this tutorial to install my wordpress. All works perfect.

But in step five i’ve a doubt in nginx server block. I don’t know which is the best option in “server name” :

server {
        root /var/www/html;
        index index.php index.html index.htm;


What option would you recommend: IP or domain name?


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.

You should use the domain name for that. The main use of the server_name configuration is if you have multiple domains or subdomains hosted at the same IP address. It allows Nginx to direct requests to the right place.