我已经按照 安装指南 在运行 Ubuntu 的服务器上成功部署了 Parse Server,HTTP 一切正常,服务器(
http://www.example.com:1337/parse
)正确响应请求,仪表板(http://www.example.com:4040
)看起来很好。
然后我添加了一个 SSL 证书,并在 apache 中更新了我的域配置:
<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot /var/www/html/example.com
ServerName example.com
SSLEngine on
SSLCertificateFile /etc/certificate/example.com.cer
SSLCertificateKeyFile /etc/certificate/example.com.key
ErrorLog /var/log/apache2/example.com/error.log
CustomLog /var/log/apache2/example.com/access.log combined
</VirtualHost>
到达
https://www.example.com
现在可以正常工作并且是安全的。但是后来我尝试像这样更新我的解析服务器配置:
{
"appId": "appId",
"masterKey": "masterKey",
"clientKey": "clientKey",
"appName": "MyParseApp",
"cloud": "./cloud/main",
"serverURL": "https://www.example.com:1337/parse",
"databaseURI": "postgres://postgres:mypostgrespassword@localhost:5432/postgres"
}
在为 serverURL 设置 https 而不是 http 时启动服务器时,我在日志中得到了这个:
[21448] parse-server running on https://www.example.com:1337/parse
WARNING, Unable to connect to 'https://www.example.com:1337/parse'. Cloud code and push notifications may be unavailable!
当尝试卷曲服务器 URL 时,结果如下:
-> 对于 http:(预期结果)
root@localhost:~/parse-server# curl http://www.example.com:1337/parse
{"error":"unauthorized"}
-> 对于 https:
root@localhost:~/parse-server# curl https://www.example.com:1337/parse
curl: (35) error:0A00010B:SSL routines::wrong version number
我在配置中遗漏了什么吗?谢谢你的帮助。