nginx代理内网oralce数据库地址
客户申请了两台云服务器,一个公网ip;一应用一数据;
上线后导致运维困难,无法便捷查看生产数据库。
因此使用nginx代理数据库地址
- 新增steam模块
yum安装nginx
yum -y install nginx nginx-mod-http-image-filter nginx-mod-http-perl nginx-mod-http-xslt-filter nginx-mod-mail nginx-mod-stream
- 配置nginx.conf
与http平级
stream {
#oralce
server {
listen 1521;
proxy_pass 172.16.0.4:1521;
}
}
- 刷新配置
./nginx -s reload
- 验证