我已经按照本教程安装parse-server在 DigitalOcean Ubuntu Droplet 上。我也安装了parse-dashboard。
除了我不能curl使用SSL. 常规HTTP工作正常。IE:
curl -H "X-Parse-Application-Id: AppID" https://mywebsite/parse/classes/GameScore
Run Code Online (Sandbox Code Playgroud)
返回Cannot GET /classes/GameScore。
我也无法访问parse-dashboardover SSL,但HTTP工作正常(这意味着我的密钥可能会泄漏)。
POST 请求返回一个Cannot POST.
我试过启用/禁用防火墙 ( ufw) 但它没有改变任何事情。
我可以使用 SDK 保存数据,但速度很慢。我的 nginx 配置文件与教程中的相同。
有任何想法吗?
编辑:
Nginx 配置:
# HTTP - redirect all requests to HTTPS
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
return 301 https://$host$request_uri;
}
# HTTPS - serve HTML from /usr/share/nginx/html, proxy requests to /parse/
# through to Parse Server
server {
listen 443;
server_name your_domain_name;
root /usr/share/nginx/html;
index index.html index.htm;
ssl on;
# Use certificate and key provided by Let's Encrypt:
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
# Pass requests for /parse/ to Parse Server instance at localhost:1337
location /parse/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:1337/;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_redirect off;
}
location / {
try_files $uri $uri/ =404;
}
}
Run Code Online (Sandbox Code Playgroud)
netstat -anlp | 443:
netstat -anlp | grep 443
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
-
Run Code Online (Sandbox Code Playgroud)
HTTPS 指南有错误,设置proxy_pass为
proxy_pass http://localhost:1337/parse/;
Run Code Online (Sandbox Code Playgroud)
并且必须在没有端口 1337 的情况下完成 curl 请求,就像这个
curl -H "X-Parse-Application-Id: appID" https://example.com/parse/classes/SomeClassName
Run Code Online (Sandbox Code Playgroud)
仪表盘
我解决了这个问题,我通过SSH 隧道连接到服务器并作为本地主机连接到仪表板,这意味着您不需要任何凭据,它将在 localhost 上的 http 上运行,因为您将通过 SSH 隧道获得保护,我还打开了仪表板仅在我需要时...如何设置 SSH 隧道
| 归档时间: |
|
| 查看次数: |
1836 次 |
| 最近记录: |