Nginx反向代理HTTP、HTTPS、TCP配置

1.引入依赖包

安装 gcc、pcre-devel、zlib zlib-devel、openssl openssl-devel 四个依赖包:

  yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

2.安装Nginx

1、解压Nginx的tar 包

  tar -zxvf nginx-1.9.9.tar.gz

2、安装Nginx至指定目录

  cd nginx-1.9.9/ 
  ./configure --prefix=/home/yunpay/nginx  --with-stream --with-http_ssl_module
  make && make install  

/** 注释 **/
Nginx安装默认是不支持TCP协议和HTTPS协议请求的:

  ./configure --prefix=/home/yunpay/nginx

所以如需支持TCP协议请求,需要引入with-stream模块:

  ./configure --prefix=/home/yunpay/nginx  --with-stream

如需支持HTTPS协议请求,需要引入with-http_ssl_module模块:

  ./configure --prefix=/home/yunpay/nginx  --with-http_ssl_module

此处因都需要支持,所以编译语句为:

  ./configure --prefix=/home/yunpay/nginx  --with
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值