Created on 12-11-2018 08:50 AM - edited 09-16-2022 06:58 AM
Created 12-11-2018 09:16 AM
Hello,
In order to try to help you with this issue we will need to see more log data or you will need to review the log data. A 404 error is a generic error code which may originate from one of two places in your scenario. The 404 may originate directly from Nginx or it may originate from Hue.
You will need to review the nginx logs and hue logs to determine what is returning the 404 error and for what resource. One way to make this easier is to remove one of your upstream servers from the server group so that it only proxies to one Hue instance while you investigate the 404 error condition.
Created 12-11-2018 09:34 AM
Created on 12-11-2018 12:15 PM - edited 12-11-2018 12:18 PM
Nginx log:
2018/12/11 19:44:51 [warn] 19347#19347: could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
2018/12/11 19:51:44 [error] 19352#19352: *3 open() "/www/gravalytics/public/favicon.ico" failed (2: No such
2018/12/11 20:04:18 [error] 19352#19352: *14 connect() failed (111: Connection refused) while connecting to upstream, client: <client_ip>, server: gravalytics.com, request: "GET / HTTP/1.1", upstream: "http://<node1_ip>:8888/", host: "gravalytics.com:8001", referrer: "https://gravalytics.com/"
2018/12/11 20:04:18 [error] 19352#19352: *14 connect() failed (111: Connection refused) while connecting to upstream, client: <client_ip>, server: gravalytics.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://<node1_ip>:8888/favicon.ico", host: "gravalytics.com:8001", referrer: "https://gravalytics.com:8001/"
There is no entry in the Hue instance log in /var/log/hue-httpd/ folder.
Created 12-13-2018 06:56 AM
Hello,
While we do not provide support directly for Nginx reviewing the log data you have posted it would appear as though the Hue backend you are attempting to proxy to on Node 1 is not accepting incoming request. Are you sure that there are no firewalls between the proxy and the node yo uare connecting to? Are you sure that Hue is available at the address you have configured?
2018/12/11 20:04:18 [error] 19352#19352: *14 connect() failed (111: Connection refused) while connecting to upstream, client: <client_ip>, server: gravalytics.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://<node1_ip>:8888/favicon.ico", host: "gravalytics.com:8001", referrer: "https://gravalytics.com:8001/"
Created 12-13-2018 11:11 AM
Firewall rules are setup to allow traffic from nginx vm to cluster.
Hue is running on that node and port.
Created 12-13-2018 11:17 AM
Also another thing to note.
This config works for http (nginx) to http (hue), but fails for https (nginx) to http (hue).
Created 12-14-2018 09:17 AM
Outside of the last time items below I am not seeing anything else that might be wrong with your configuration. Are you certain that TLS is not already enabled on Hue?
You seem to have proxy_set_header Host twice in the first location path. Can you please remove this one shown below?
> proxy_set_header Host $host;
Also please uncomment the follow line under the static location. This alias is required if you deployed using parcels if you deployed using packages the path will be slightly different.
> #alias /opt/cloudera/parcels/CDH/lib/hue/build/static/;
If you used packages.
# If Hue was installed with packaging install:
## alias /usr/lib/hue/build/static/;
Created on 12-17-2018 07:19 AM - edited 12-17-2018 07:50 AM
Changed what you requested. Did not help.
Created 12-17-2018 10:24 AM
Hello,
Can you try commenting out this line in your nginx configuration?
> proxy_set_header X-Forwarded-Proto https;
The error that you are reporting now is being returned directly by Nginx. It means that something is trying to use plain text instead of TLS. You may also have to alter the way the server is configured. At the moment you have set Nginx to accept on TLS request only which may impact your ability to proxy to the backend since it does not use TLS.
You may need to alter the server block, you may need to comment out:
> ssl on
Then alter the listen paramter on Niginx like so:
> listen 8001 ssl;
https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-tcp/