Support Questions

Find answers, ask questions, and share your expertise

Nifi Nginx Proxy 502 Bad Gateway Error

avatar
New Contributor

I have followed the instructions found in the article Running Apache Nifi behind a proxy. I am using nginx as my proxy server. I am currently getting 502 Bad Gateway errors when I browse to the proxy nifi url. In the logs for nginx I see this error: (peer closed connection in SSL handshake while SSL handshaking to upstream). I have done some troubleshooting using openssl s_client -connect.

When I run the openssl s_client -connect from the nginx proxy to the nifi server I get the following error 140658986932128:error:140790E5:SSL routines:ssl23_write:ssl handshake failure:s23_lib.c:177:,

followed by a successful connection, however, the TLS session ticket is not displayed. I know this is a bit all over the place, but I have been trying to work through this for several days. Below is my location configuration for nginx. Any ideas or help would be greatly appreciated.

location /nifi {

proxy_set_header X-ProxyScheme $scheme; p

proxy_set_header X-ProxyHost <proxy_hostname>;

proxy_set_header X-ProxyPort 443;

proxy_set_header X-ProxyContextPath "";

proxy_set_header X-ProxiedEntitiesChain $ssl_client_s_dn;

proxy_pass https://nifi/nifi; }

2 REPLIES 2

avatar

I got HTTP 502 the first time I tried the proxy and then I fixed the iptables. You could try: iptables -I INPUT -j ACCEPT as a test. This opens up everything.

avatar
Expert Contributor

I got similar problem with Sandbox on Windows host. When I comment out any other 127.0.0.1 names and just left

127.0.0.1 localhost sandbox.hortonworks.com sandbox-hdp.hortonworks.com sandbox-hdf.hortonworks.com

line in hosts file, then I was able to see Ambari login.