Skip to content
Advertisement

can not connect to postgres db from node server

I want to connect my apps nodejs using node-posgres to PostgreSQL. My apps in linux server and my postgresql in another linux server by 176.9.154.123 IP.

this is my error:

enter image description here

this is my pg_hba.conf:

host    all             all             176.9.154.123/32        trust

Advertisement

Answer

i can solve this problem by add this line to postgressql.conf:

listen_addresses = '*'
Advertisement