Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

redash configured in nginx conf file with server location is duplicating the url path #6777

Unanswered
rajnathsah asked this question in Q&A
Discussion options

My nginx conf file entry for redash

location /redash/ {
 sub_filter ="/" ="/redash/";
 sub_filter ="/static/ ="/redash/static/;
 sub_filter ="/ldap/ ="/redash/ldap/;
 sub_filter ="/saml/login ="/redash/saml/login;
 sub_filter url(/static url(/redash/static;
 sub_filter_once off;
 sub_filter_types application/javascript text/css text/xml text/javascript application/json text/plain;
 proxy_set_header Host $http_host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
 proxy_set_header SCRIPT_NAME /redash;
 proxy_pass http://127.0.0.1:5000;
}

This work for the server but when i refresh my page. On first access, i see url like this http://localhost/redash/

but on sub-sequent refresh redash gets appended, After multiple refresh, url looks like below.

http://localhost/redash/redash/redash/redash/redash/redash/redash/redash/redash/

Is there anything wrong with my redash configuration?

You must be logged in to vote

Replies: 1 comment 4 replies

Comment options

You also need to proxy pass /api end point to the redash server. I have redash working behind a reverse proxy using path based routing.
https://info.aiims.edu/ehospital/public/dashboards/S8h17l4l2uKK1gYyCG0T2mjmcau3hbdZCYi3QQoL

Will share working nginx configuration tomorrow morning

You must be logged in to vote
4 replies
Comment options

@drguptavivek Are you ok for that to go in a list of good example (public) dashboards, probably on the wiki?

Comment options

@drguptavivek Are you ok for that to go in a list of good example (public) dashboards, probably on the wiki?

Sure !

Comment options

Hello, did you finally shared the nginx conf?
Thanks

Comment options

Aaah yes. Here it is
https://epidemiology.tech/linux/public-redash-dashboards-with-path-based-routing-behind-a-nginx-reverse-proxy/

upstream redash_servers {
 server XXX.XXX.X.X:XXXX;
}
server {
 listen 443 ssl;
 server_name subdomain.domain.tld;
 ssl_certificate /etc/XXXXX/XXXXX.crt;
 ssl_certificate_key /etc/XXXXX/XXXXX.key;
 ssl_protocols XXXXXXXXX;
location /api {
 proxy_pass http://redash_servers ;
 proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
}
location /dashboard1/ {
 sub_filter ="/" ="/dashboard1/";
 sub_filter ="/static/ ="/dashboard1/static/;
 sub_filter ="/ldap/ ="/dashboard1/ldap/;
 sub_filter ="/api/ ="/dashboard1/api/;
 sub_filter ="/api/ ="/dashboard1/ldap/;
 sub_filter ="/saml/login ="/dashboard1/saml/login;
 sub_filter ="/api/config ="/dashboard1/api/config;
 sub_filter ="/api/events ="/dashboard1/api/events;
 sub_filter url(/static url(/dashboard1/static;
 sub_filter url(/api url(/dashboard1/api;
 sub_filter ="/public/dashboards/ ="/dashboard1/public/dashboards/;
 sub_filter_once off;
 sub_filter_types application/javascript text/css text/xml text/javascript application/json text/plain;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
 proxy_set_header SCRIPT_NAME /dashboard1;
 proxy_pass http://redash_servers ;
 proxy_set_header Host $host;
 }
 location /dashboard1/login {
 # allow XXX.XXX.X.X;
 deny all;
 }
location /dashboard2/ {
 sub_filter ="/" ="/dashboard2/";
 sub_filter ="/static/ ="/dashboard2/static/;
 sub_filter ="/ldap/ ="/dashboard2/ldap/;
 sub_filter ="/api/ ="/dashboard2/api/;
 sub_filter ="/api/ ="/dashboard2/ldap/;
 sub_filter ="/saml/login ="/dashboard2/saml/login;
 sub_filter ="/api/config ="/dashboard2/api/config;
 sub_filter ="/api/events ="/dashboard2/api/events;
 sub_filter url(/static url(/dashboard2/static;
 sub_filter url(/api url(/dashboard2/api;
 sub_filter ="/public/dashboards/ ="/dashboard2/public/dashboards/;
 sub_filter_once off;
 sub_filter_types application/javascript text/css text/xml text/javascript application/json text/plain;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
 proxy_set_header SCRIPT_NAME /dashboard2;
 proxy_pass http://redash_servers ;
 proxy_set_header Host $host;
}
 location /dashboard2/login {
# allow XXXX.XXX.XXX.XXX;
 deny all;
 }
 location /dashboard3/ {
 sub_filter ="/" ="/dashboard3/";
 sub_filter ="/static/ ="/dashboard3/static/;
 sub_filter ="/ldap/ ="/dashboard3/ldap/;
 sub_filter ="/api/ ="/dashboard3/api/;
 sub_filter ="/api/ ="/dashboard3/ldap/;
 sub_filter ="/saml/login ="/dashboard3/saml/login;
 sub_filter ="/api/config ="/dashboard3/api/config;
 sub_filter ="/api/events ="/dashboard3/api/events;
 sub_filter url(/static url(/dashboard3/static;
 sub_filter url(/api url(/dashboard3/api;
 sub_filter ="/public/dashboards/ ="/dashboard3/public/dashboards/;
 sub_filter_once off;
 sub_filter_types application/javascript text/css text/xml text/javascript application/json text/plain;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Forwarded-Proto $scheme;
 proxy_set_header SCRIPT_NAME /dashboard3;
 proxy_pass http://redash_servers ;
 proxy_set_header Host $host;
 }
 location /dashboard3/login {
 # allow XXX.XXX.XXX.XXX;
 deny all;
 }
}
server {
 listen 80;
 server_name subdomain.domain.tld;
 return 301 https://$host$request_uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /