无法上网发邮件的centos7服务器通过可以上网的服务器发送邮件-nginx代理smtp

本文介绍了在无法直接访问互联网的CentOS7服务器上,如何通过已有的可上网服务器使用Nginx作为SMTP代理来发送邮件。主要步骤包括:安装和配置Nginx的stream模块、SSL模块,以及修改客户端的mail配置来设置SMTP服务器为内网Nginx服务器的地址。
摘要由CSDN通过智能技术生成

参考:https://blog.csdn.net/ygqygq2/article/details/77479765

1)确认安装pcre和openssl(不知道是否有用,但是装了不出错)
yum install -y pcre openssl

2) git获取ssl module(这个和参考不一样,可能地址变了。)
git clone https://github.com/yaoweibin/nginx_upstream_check_module.git

3)编译
./configure --with-http_stub_status_module --with-stream=dynamic --with-stream_ssl_module --with-pcre --with-http_ssl_module --add-module=../nginx_upstream_check_module
make
make install

4)改配置
 

[root@msg6 nginx]# cat /usr/local/nginx/conf/nginx.conf
#user  www;
worker_processes  8;

error_log  logs/info.log  info;

#pid        logs/nginx.pid;

load_module modules/ngx_stream_module.so;  # 此处要添加模块

events {
    worker_connections  1024;
}

http {
   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值