简体   繁体   中英

Connect to pgadmin client through reverse proxy

I have a Postgres Database in private subnet on AWS and I want to connect to 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.

User -> pgadmin client -> Reverse proxy on 443 -> RDS.

As information, i can open only 443 and 80 on public subnet.

my Apache configuration :

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. 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. You should grant your EC2 server to connect on 5432 to RDS on security group config.

I personally don't install an apache on proxy EC2 server. I open a tunnel via my EC2 server and map 5432 port to my local.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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