惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
D
Docker
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
美团技术团队
V
V2EX
Last Week in AI
Last Week in AI
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Microsoft Security Blog
Microsoft Security Blog
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
B
Blog RSS Feed
博客园_首页
B
Blog
博客园 - 叶小钗
I
InfoQ
WordPress大学
WordPress大学
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
Latest news
Latest news
W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
C
CXSECURITY Database RSS Feed - CXSecurity.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
N
News and Events Feed by Topic
S
Secure Thoughts
The Hacker News
The Hacker News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News

Rat's Blog - Haproxy

Haproxy一键安装脚本,可转发端口改善服务器的网络状况 - Rat's Blog Haproxy安装及端口转发配置 - Rat's Blog
使用haprxoy隐藏SMTP发信服务器源IP地址方法 - Rat's Blog
博主: Rat's · 2017-05-23 · via Rat's Blog - Haproxy
  •  发布时间:
  •  15527 次浏览
  •   暂无评论
  •  1352 字数
  • 分类: 主机教程
  1.  首页
  2. 正文  
  3. 分享到:

SMTP发信会暴露网站服务器的IP(即使用了CDN)。如何隐藏服务器源IP呢,可以使用haproxy来端口转发来完成。

方法

1、需要找一台机器做中转,先安装Haproxy,具体可参考Haproxy安装及端口转发配置

2、把下面的内容写入到haproxy.cfg文件中

global
ulimit-n  51200
defaults
log global
mode    tcp
option  dontlognull
timeout connect 1000ms
timeout client 150000ms
timeout server 150000ms
listen status
bind 0.0.0.0:1080
mode http
log global
stats refresh 30s
stats uri /admin?stats
stats realm Private lands
stats auth admin:password
stats hide-version
frontend ssin
bind *:465
#如果是普通模式,那这里就填25,如果是SSL模式,就需要填465
default_backend ssout
backend ssout
server server1 11.22.33.44 maxconn 204800
#这里的IP需要改成SMTP地址的IP,ping一下SMTP域名即可得到地址

3、修改完成后,执行重启命令,并设为开机启动

service haproxy restart
chkconfig haproxy on

4、登录WEB服务器,把smtp地址写进/etc/hosts文件,指向中转服务器的IP。假如我使用的是阿里云的邮件推送,那么它的SMTP服务器域名就是smtpdm.aliyun.com然后编辑/etc/hosts文件

[root@sscloud ~]# vim /etc/hosts
127.0.0.1 localhost
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.16.156.98 sscloud
22.33.44.55  smtpdm.aliyun.com
//22.33.44.55就是中转服务器的IP

修改完成后,执行service network restart重启网卡即可。

原文地址:https://www.gaomingsong.com/537.html


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/131/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。