我有一个第三方服务,可以发布请求。我在新的云计算服务(亚太地区)上进行了此设置。在新服务器上,我无法收到发布请求(通过此服务,我可以使用curl和postman进行发布,这似乎还可以)。我注意到以下错误(尤其是111连接失败,但也定期出现110上游超时)。我遵循了流行的答案here和here。
我应该在我的nginx配置上使用上游吗?
ty!
日志示例:
upstream timed out (110: Connection timed out) while reading response header from upstream, client: 1xx.xx.xxx.xx, server: mydomain.hk, request: "POST /checkout/someservice/notifyUrl/ HTTP/1.1", upstream: "http://127.0.0.1:3000/checkout/someservice/notifyUrl/", host: "mydomain.hk"
nginx:
server {
listen 80;
listen [::]:80;
server_name mydomain.hk;
return 301 https://mydomain.hk$request_uri;
}
server {
# SSL configuration
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mydomain.hk;
ssl_certificate /etc/nginx/my-cert-bundle.crt;
ssl_certificate_key /etc/nginx/mycertkey.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
root /var/www/react_app;
# Add index.php to the list if you are using PHP
# index index.html index.htm index.nginx-debian.html;
location / {
try_files $uri @app;
}
location @app {
root /var/www/express_app;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3000;
# these two lines here
proxy_http_version 1.1;
proxy_set_header Connection "";
}
location /shop {
root /var/www/react_app;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
index index.html;
try_files $uri /index.html;
proxy_pass http://127.0.0.1:3001;
}
}