尝试代理请求时 Gatsby 出错
尝试通过 Gatsby 代理我的开发 URL 时出现错误。在我的 gatsby-config.js 中,我有:
proxy: [
{
prefix: '/myaccount',
url: 'https://www-dev.site.com',
},
],
尝试时出错将请求“/myaccount/”代理到“https://www-dev.site.com/myaccount/”写入 EPROTO 4584046080:error:14094458:SSL例程:ssl3_read_bytes:tlsv1无法识别的名称:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL警报号112
RequestError:写入EPROTO 4555591168:错误:14094458:SSL例程:ssl3_read_bytes:tlsv1无法识别的名称:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL警报号112
这正在工作,突然停止了。
I am getting an error when trying to proxy my dev url through Gatsby. In my gatsby-config.js I have:
proxy: [
{
prefix: '/myaccount',
url: 'https://www-dev.site.com',
},
],
Error when trying to proxy request "/myaccount/" to "https://www-dev.site.com/myaccount/" write EPROTO 4584046080:error:14094458:SSL routines:ssl3_read_bytes:tlsv1 unrecognized name:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 112
RequestError: write EPROTO 4555591168:error:14094458:SSL routines:ssl3_read_bytes:tlsv1 unrecognized name:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 112
This was working and all of a sudden stopped.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如前面所说,这看起来像是一个证书问题(因为 SSL)。如果没有更多实现细节,很难猜测建议的解决方案是否适用于您的场景,但您可以尝试将安全性设置为 false (
secure: false
),以免拒绝自签名证书。在您的gatsby-config.js
中:文档:https://www.gatsbyjs.com/docs/api-proxy/#self-signed-certificates
调整它以适应您的需求,替换
/.netlify/functions/
用于您的 API 端点。As it has been said, it looks like a certificate issue (because of the SSL). Without more implementation details it's difficult to guess if a proposed solution will work on your scenario but you can try setting the security as false (
secure: false
) to don't reject self-signed certificates. In yourgatsby-config.js
:Docs: https://www.gatsbyjs.com/docs/api-proxy/#self-signed-certificates
Tweak it to adapt it to your needs, replacing
/.netlify/functions/
for your API endpoint.