简体   繁体   English

通过反向代理连接到pgadmin客户端

[英]Connect to pgadmin client through reverse proxy

I have a Postgres Database in private subnet on AWS and I want to connect to AWS. 我在AWS上的私有子网中有一个Postgres数据库,我想连接到AWS。

So i create an ec2 with httpd (Apache) as a reverse proxy in public subnet in order to forward my request to RDS database. 所以我创建一个带有httpd(Apache)的ec2作为公共子网中的反向代理,以便将我的请求转发到RDS数据库。

User -> pgadmin client -> Reverse proxy on 443 -> RDS. 用户 - > pgadmin客户端 - > 443上的反向代理 - > RDS。

As information, i can open only 443 and 80 on public subnet. 作为信息,我只能在公共子网上打开443和80。

my Apache configuration : 我的Apache配置:

ProxyPass /rds  http://rds-link.compute.amazonaws.com:5432
ProxyPassReverse /rds  http://rds-link.compute.amazonaws.com:5432

in Postgres pgadmin (my laptop) I tried to connect to database using https://link-of-reverse-proxy/rds as host , but its not wokring. 在Postgres pgadmin(我的笔记本电脑)我尝试使用https:// link-of-reverse-proxy / rds作为主机连接到数据库,但它没有w。 i receive the error : could not translate host name to address 我收到错误:无法将主机名转换为地址

Did i miss something ? 我错过了什么 ?

Thank you in advance 先感谢您

Make sure your EC2 server has access to RDS. 确保您的EC2服务器可以访问RDS。 You should grant your EC2 server to connect on 5432 to RDS on security group config. 您应该授予您的EC2服务器以5432连接到安全组配置上的RDS。

I personally don't install an apache on proxy EC2 server. 我个人不在代理EC2服务器上安装apache。 I open a tunnel via my EC2 server and map 5432 port to my local. 我通过我的EC2服务器打开一个隧道,并将5432端口映射到我的本地。

ssh ec2-user@my.ec2.server.ip -L 5432:rdshost.eu-west-2.rds.amazonaws.com:5432

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM