配置文件服务器

server{

           listen  端口号;

           server_name   localhost;

           charset utf-8;

          root    放文件的路径;

           location   /{

                   access_log  on;

                   autoindex on;} 

}

查看nginx的安装目录:

                ps  -ef | grep nginx

检查语法:sudo nginx -t

重启:sudo nginx -s reload

nginx 的路径:

   /etc/nginx/conf.d

用sudo vim  xx.conf 开始更改配置

访问请求的url:ip+端口号;

猜你喜欢

转载自www.cnblogs.com/1a2a/p/9558584.html