Configuring nginx virtual machine

First, add files

 /var/wwwroot/site1/index.html, save the content for
<?php

phpinfo();

Second, find nginx profile, my profile is /etc/nginx/conf.d/default.conf

Third, the default.conf is amended as follows

server {

    listen       80;

    server_name  www.test.com;

 
    location / {

        root   /var/wwwroot/site1;

        index  index.html index.htm index.php; 

    }

}

 Fourth, restart nginx

service nginx restart

Fifth, open the browser, enter www.test.com, will see the information output of phpinfo

Guess you like

Origin www.cnblogs.com/ivy-zheng/p/10989752.html