nginx入门实战

nginx 安装与卸载

下载安装

进入 http://nginx.org/en/download.html

下载自己想要的版本,我选择的stable版本

tar -zxvf nginx.tar.gz
cd nginx
./configure
make
make install # 如果报错 使用 sudo make install

使用

upstream hello.com {
server 127.0.0.1:8084 weight=1;
server 127.0.0.1:8084 weight=1;
}
server {
location / {
proxy_pass http://hello.com;
proxy_redirect default;
}
}

接下来访问 http://localhost:8080/hello来测试

遇到的问题

  • nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

    • 解决方案

      • 需要刚开始执行nginx 加载nginx.conf文件
      • sudo ./nginx -c /usr/local/nginx/conf/nginx.conf

参考文章

最新文章

  1. mysql索引总结----mysql 索引类型以及创建
  2. Netty学习四:Channel
  3. 关于php中的spl_autoload_register
  4. C# Windows - ListView
  5. c语言学习之基础知识点介绍(十五):函数的指针
  6. php socket 通信
  7. linux ar 命令的使用
  8. NodeJS 实现 客户端 js 加密
  9. phpmailer的SMTP ERROR: Failed to connect to server: 10
  10. Hibernate之HelloWorld
  11. 为Hi3531添加4串口支持
  12. less和sass的区别
  13. vue的技巧代码
  14. POJ - 题解sol[暂停更新]
  15. 服务端REST与SOAP的探讨(转)
  16. UVaLive 6525 Attacking rooks (二分图最大匹配)
  17. 怎样将word中的图片插入到CSDN博客中
  18. 20144303 《Java程序设计》第六周学习总结
  19. 目标探测:r-cnn, fast-rcnn, faster-rcnn, yolo, mask-rcnn
  20. [JS学习笔记]Javascript事件阶段:捕获、目标、冒泡

热门文章

  1. 一次生产的JVM优化
  2. Excel学习笔记:行列转换
  3. Redis之淘汰策略
  4. webpack中使用html-webpack-plugin生成HTML文件并主动插入css和js引入标签
  5. 前端配置jenkins
  6. Hive的日志操作
  7. 如何解决comctl32.dll文件丢失的问题?
  8. 7、Nginx基础Http原理
  9. 第一章·MySQL介绍及安装
  10. linux 内核网络数据包接收流程