【发布时间】:2022-10-04 22:28:40
【问题描述】:
从今天早上开始,我尝试使用 https 协议在远程数据库上模拟 POST 请求,因为我安装了 ssl 证书。 (我的网站是安全的)。
https://example.com/api/v1/data_tag
但是当我尝试以安全模式向我的数据库发送邮递员请求时,我收到此错误:
SSL Error: Unable to verify the first certificate
当我从我的网址中的 https 中删除“s”时,请求已正确完成。
http://biotagsensor.com:3000/api/v1/data_tag
我以这种方式配置了我的服务器的防火墙:
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
80/tcp ALLOW IN Anywhere
443/tcp ALLOW IN Anywhere
80/tcp (Nginx HTTP) ALLOW IN Anywhere
3000 ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)
80/tcp (v6) ALLOW IN Anywhere (v6)
443/tcp (v6) ALLOW IN Anywhere (v6)
80/tcp (Nginx HTTP (v6)) ALLOW IN Anywhere (v6)
3000 (v6) ALLOW IN Anywhere (v6)
这是 nginx 的默认文件:
upstream backend {
server localhost:3000;
}
server {
listen 80;
rewrite ^ https://$host$request_uri? permanent;
}
server {
# listen 80 default_server;
# listen [::]:80 default_server;
listen 443 ssl;
ssl_certificate /home/debian/site.com.chain.pem;
ssl_certificate_key /home/debian/myserver.key;
root /home/debian/site.com/dist;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location ^~ /api {
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass http://backend;
proxy_set_header Host $host ;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
你知道这可能来自哪里吗?
【问题讨论】:
标签: nginx ssl https postman ssl-certificate