闲来无聊看看 Nginx .
- 操作系统: Ubuntu 14.04
- 安装方式: Build source
- 安装之前使用./configure 检查是否可以进行安装是否缺少模块
1 | $ ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre |
发生错误:
1 | $ ./configure: error: the HTTP rewrite module requires the PCRE library. |
解决办法:
1 | $ sudo apt-get install libpcre3 libpcre3-dev |
然后继续执行./configure 的命令 发现又少东西了~ 这次是 openssl
发生错误:
1 | $ ./configure: error: SSL modules require the OpenSSL library. |
解决办法:
1 | sudo apt-get install openssl libssl-dev |
然后继续./configure
OK 搞定了~ 安装吧~
1 | $ make |
nginx.conf 配置
需求:是想让 nginx 反向代理到本机 node express 启动的一个web 程序上但是想让在解析的时候浏览器输入 localhost8081/express 解析解析到localhost:3000上.
1 | server{ |