、重要:修改配置文件使用虚拟机,否则怎么配置都不生效,添加如下用户

[root@host---- html]# ll /etc/nginx/nginx.conf
-rw-r--r-- root root Aug : /etc/nginx/nginx.conf
[root@host---- html]# vi /etc/nginx/nginx.conf
user root root; #说明:这里的user根据 自己的nginx.conf文件所在的目录的属主属性而定
worker_processes ; 、其他目录下的 html文件,必须写成 index.html 否则无法访问 [root@host---- ~]# curl http://127.0.0.1:8080
<html>
<head><title> Forbidden</title></head>
<body bgcolor="white">
<center><h1> Forbidden</h1></center>
<hr><center>nginx/1.12.</center>
</body>
</html>
[root@host---- ~]# mv /web/sing/sina.html /web/sing/index.html
[root@host---- ~]#
[root@host---- ~]# curl http://127.0.0.1:8080
<html>
<p>
this is my nginx
</p>
</html>

最新文章

  1. Web API后端调用接口 (Get,POST,Put,Delete)
  2. javase基础复习攻略《五》
  3. sqlite之WAL模式
  4. 使用Sharepoint定时运行Excel中宏程序
  5. lintcode: 生成括号
  6. POJ 1251 Jungle Roads
  7. PHP多维数组的魅力
  8. 如何用 React Native 创建一个iOS APP?(三)
  9. c# xml操作类 比较齐全
  10. zookeeper curator处理会话过期session expired
  11. 一键安装 redmine on windows 和发邮件设置
  12. 使用 Sonar 检测代码质量
  13. 【winform】DataGridView控件[表格]
  14. R语言-散点图阵
  15. Maven 基本参数
  16. (转)BT1120接口及协议
  17. jquery.ellipsis根据宽度(不是字数)进行内容截断,支持多行内容
  18. DOS磁盘操作类命令
  19. 通信与实际用例应用(消息队列和进程撰写的ATM机与消息队列的五子棋对站)
  20. php call_user_func_array

热门文章

  1. Red Hat Enterprise Linux 7.0
  2. vue 标题上下滚屏 无缝轮播
  3. CallContext线程数据缓存-调用上下文
  4. 6、获取Class中的方法
  5. 行内元素进行绝对(absolute),固定(fixed)定位后会变成块级元素&#183;
  6. CF70E Information Reform
  7. vue中把props中的值赋值给data
  8. 020_统计 13:30 到 14:30 所有访问 apache 服务器的请求有多少个
  9. windows下SVN日志反馈中文乱码的解决方法
  10. GitLab 如何删除 Forked from