1, install and remove off after re-install the file did not nginx.conf
Solution:
apt-get -y --purge remove nginx*
apt-get -y autoremove
apt -y install nginx
2, set up a file server:
apt -y install nginx #安装
cp /etc/nginx/nginx.conf{,.bak} # backup master configuration file
vim /etc/nginx/conf.d/file.conf # Configuration file
{Server
the listen 80; # listening port
server_name 192.168.1.101; # ip domain name of your own PC or server
charset utf-8; # avoid Chinese garbled
root / var / www / html; # file path
LOCATION / {
autoindex ON; Index #
autoindex_exact_size on; # shows the file size
autoindex_localtime on; # display the file time
}
}
service nginx reload # reload