老师 我也遇到了同样的问题:
axios请求书本详情页和搜索书籍,在本地可以正常访问到数据。但是部署到自己的服务器后报错如下:
0|app | Error: getaddrinfo ENOTFOUND t.yushu.im
0|app | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)
是不是服务器上的HTTPS配置问题:
upstream app_weapp {
server localhost:3000;
keepalive 8;
}
server {
listen 80;
server_name mi.com;
rewrite ^(.*)$ https://$server_name$1 permanent;
}
server {
listen 443 ssl;
server_name mi.com;
ssl_certificate /data/release/nginx/3493452.pem;
ssl_certificate_key /data/release/nginx/3493452.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
ssl_session_cache shared:SSL:50m;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://app_weapp;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}