-
Notifications
You must be signed in to change notification settings - Fork 4.5k
redash configured in nginx conf file with server location is duplicating the url path #6777
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 4 replies
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2
-
@drguptavivek Are you ok for that to go in a list of good example (public) dashboards, probably on the wiki?
Beta Was this translation helpful? Give feedback.
All reactions
-
@drguptavivek Are you ok for that to go in a list of good example (public) dashboards, probably on the wiki?
Sure !
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello, did you finally shared the nginx conf?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions
-
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;
}
Beta Was this translation helpful? Give feedback.