Server Name: Ip or domain (Nginx Server Block )

Posted September 19, 2014 10k views

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?


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.

Submit an Answer
1 answer

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.