Running Looker behind a proxy server or load balancer

There are a few issues that can be caused by load balancers.

First, if the timeout is too short on the load balancer, Looker may generate a gateway timeout error. This error occurs in the javascript and manifests in the Looker app as a generic “Something Went Wrong” error. The only way to see the timeout error is with the developer / javascript console, where you will see a gateway timeout error on one of the JS calls.

Second, the headers may get messed up by the load balancer. Internally, Looker uses the following settings on our proxy server to avoid this issue:

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# Uncomment if behind ELB
#real_ip_header X-Forwarded-For;
#set_real_ip_from 10.0.0.0/8;
#set_real_ip_from 172.16.0.0/12;
#set_real_ip_from 192.168.0.0/16;

proxy_set_header X-Forwarded-Proto https;
1 3 2,324
3 REPLIES 3

joshsiegel
Participant IV

To expand on this, if your browser loses connection to the web server (Looker), Looker will actively kill the query that you were running. This is to minimize load on the database, e.g. make sure that if a user starts a query, loses interest (closes the tab / browser), they are not still consuming database resources.

Many proxy settings have a default timeout (e.g. 60 seconds) that will result in any queries that take longer than the timeout period getting killed.

We are planning to have looker in a secure green zone,  and embedding looker dashboards, looks on a portal that is exposed externally on the Internet to logged in customers - do you have an architecture for this ?

Here is the flow

Browser -→  reports.mycompanyexternal.com  → Security gateway (reverse proxy) → reports.mycompanyintenal.com (looker domain)

What we notice is, when looker iFrame is loaded, on embedded login - looker redirects users to 

reports.mycompanyintenal.com/embed/*

And I notice, to completely paint the report in the iFrame, several other calls happen from browser to looker

reports.mycompanyintenal.com/api/*

reports.mycompanyintenal.com/webpack/*

This works fine in company Intranet since browser will recognize DNS: reports.mycompanyintenal.com but for a customer on the Internet, browser does not recognize reports.mycompanyintenal.com ( intranet link)  so the reports do not load inside the iFrame.

Is there a way to make this work ? 

Thanks

Sharathbabu

The solution seems to work after we added these 2 headers in the reverse proxy

X-Forwarded-Proto
X-Forwarded-Host

Thanks