Connecting Relay PostgreSQL to another server

I am using a PostgreSQL database on a remote server with a very restrictive firewall that only allows connections from our web server. This greatly complicates the development of materials on my workstation, since I cannot connect directly to this server to verify my code.

What I would like to do is set up some kind of proxy on our web server, which simply sends all requests to the server with a firewall. Then I can use our server from my workstation to check my code. Any ideas how to do this or other ways to solve my problem?

+6
source share
1 answer

use ssh and create a local tunnel, something like this (only works if you have the ssh daemon on the web server)

ssh user@www.unit4.it -CNL localhost:5432:192.168.1.128:5432 

The above will listen on 5432 (postgres port) on the local host and redirect all traffic to the remote computer via the web server.

+15
source

All Articles