我无法在 Heroku 上使用 Strapi 连接到 Postgres DB [英] I can not connect to Postgres DB with Strapi on Heroku
本文介绍了我无法在 Heroku 上使用 Strapi 连接到 Postgres DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试按照此处所述使用 Postgres 在 Heroku 上部署 Strapi
Trying to deploy Strapi on Heroku with Postgres as described here
https://strapi.io/documentation/v3.x/deployment/heroku.html
但我收到此错误
error: no pg_hba.conf entry for host "84.212.51.43", user "ssqqeaz***", database "d6gtu***", SSL off
我使用 Heroku Postgres 插件.
I use Heroku Postgres add-on.
我的数据库配置:
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'postgres',
host: env('DATABASE_HOST', '127.0.0.1'),
port: env.int('DATABASE_PORT', 27017),
database: env('DATABASE_NAME', 'strapi'),
username: env('DATABASE_USERNAME', ''),
password: env('DATABASE_PASSWORD', ''),
},
options: {
ssl: true
},
},
},
});
为什么?请帮忙!
推荐答案
尝试将 ssl : true
改为 ssl : false
这篇关于我无法在 Heroku 上使用 Strapi 连接到 Postgres DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文