Nginx与HTTPS上游失败,错误

nginx与HTTP上游协同工作,但是当我将proxy_pass更改为HTTPS时,几秒钟后失败,出现以下错误:

root@websrv1:/etc/nginx/sites-enabled# nginx -t nginx: [emerg] host not found in upstream "backend" in /etc/nginx/sites- enabled/preprod-ssl.conf:30 nginx: configuration file /etc/nginx/nginx.conf test failed 

Nginxconfiguration:

  proxy_ssl_verify off; proxy_pass https://backend; proxy_ssl_trusted_certificate /etc/nginx/trusted-ssl/nginx.crt; } upstream backend { server IP:PORT; server IP:PORT; } 

您需要启用proxy_ssl :

启用S​​SL / TLS协议以连接到代理服务器。

带有proxy_pass的NGINX到https需要DNS访问。 在防火墙启用DNS解决了这个问题。