Grafana postgreSQL data source connectivity gives 504

Hi,
We have been Testing with 4.6 version of Grafana in Our Dev environment on RHEL 7. One of the major feature we are evaluating was with the postgreSQL data source. As I try to configure the data source from the data sources page, I keep getting the following error. could any one correct me what i could be missing to verify to enable this connectivity working and where i could find more error info on this connectivity. I don’t observe anything from the grafana_logs. Thank you for your time.

grafana.log:

t=2018-03-13T12:56:53+0000 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=3 uname=admin method=POST path=/api/tsdb/query status=500 remote_addr=x.x.x.x time_ms=127255 size=229 referer=https://internal-grafana-test-abc.com/datasources/edit/407

The HTTP status code 504 is a Gateway Timeout Error meaning Grafana could not reach your Postgres server. Can you show your settings (with sensitive information removed)?

One thing to check is if you have chosen proxy or direct mode - you should choose proxy mode (unless you have very good reasons for choosing direct - direct from your browser to the database).

I am trying to add Postgres rds as datasource in Grafana , but getting 504 error

Hello kondareddy! As mentioned above, the HTTP status code 504 is a Gateway Timeout Error meaning Grafana could not reach your Postgres server. Can you show your settings (with sensitive information removed)? One thing to check is if you have chosen proxy or direct mode - you should choose proxy mode (unless you have very good reasons for choosing direct - direct from your browser to the database).

How to enable proxy mode? Can you please share more details on it.