1

nginx works with HTTP upstream, but when I change the proxy_pass to HTTPS it fails after few seconds with the following error:

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

Nginx config:

    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;
}
1
  • Please don't write "solved" in the question, instead accept your answer below. It's the only way to mark it as "solved" in the system. Aug 9, 2017 at 8:42

2 Answers 2

1

NGINX with proxy_pass to https requires DNS access. Enabling DNS at the firewall solved the issue.

2
  • Why would it require that, if upstream backend is specified as server IP:PORT;, without using DNS hostnames? Aug 9, 2017 at 7:59
  • not sure. without access to dns the above error occurs. Aug 9, 2017 at 8:01
0

You need to enable proxy_ssl:

Enables the SSL/TLS protocol for connections to a proxied server.

1
  • I tried with the same results, found out it's because the firewall blocked connections to the internet, now trying to enable only DNS at the firewall level, will update. Aug 8, 2017 at 13:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .