【发布时间】:2020-06-02 16:05:04
【问题描述】:
当我按顺序向 Facebook、Google 等 3rd 方 API 发出 POST 请求时,我随机收到 504 错误。我无法确定导致错误的确切情况。
这是我发出 POST 请求的方式:
var options = { uri: uri,
headers: {
"Content-Type": "application/json",
},
strictSSL: true,
json: obj
};
request.post(options, function(err, response) {
});
这是我的 NGINX 配置文件:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
client_max_body_size 100M;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
我在 AWS 中的 2 个 EC2 实例上运行我的应用程序,并附加了一个负载均衡器。
这可能是什么问题?
【问题讨论】:
标签: node.js amazon-web-services nginx post request