我无法在 Heroku 上使用 Strapi 连接到 Postgres DB

编程入门 行业动态 更新时间:2024-10-27 14:25:36
本文介绍了我无法在 Heroku 上使用 Strapi 连接到 Postgres DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

尝试按照此处所述使用 Postgres 在 Heroku 上部署 Strapi

Trying to deploy Strapi on Heroku with Postgres as described here

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

本文发布于:2023-10-16 05:14:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496601.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   Strapi   Heroku   Postgres   DB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!