Nginix redirect at kiosk mode

Hi, I’m using grafana behind nginix, but I’m not able to redirect to grafana as kiosk mode. Can someone help me with the correct syntax? I tryed with regex, rewrite and everything it went on mind, but nothing.
Practically, I would like that when I access to grafana it automatically goes in kiosk mode, so I thought to append kiosk. But I’m not able to do it.
These my configuration:

  • grafana.ini

http_port = 50001
domain = mydomain.com
root_url = %(protocol)s://%(domain)s:%(http_port)s/mygraf/
serve_from_sub_path = true

  • nginx

server {
listen 80;
server_name mydomain.com www.mydomain.com;
return 301 https://mydomain.com$request_uri;
}
server {
listen 443 ssl http2;
server_name mydomain.com www.mydomain.com;
index index.html index.htm index.php;
ssl_certificate /etc/nginx/ssl/mydomain.com/fullchain.cer;
ssl_certificate_key /etc/mydomain.com/ssl/mydomain.com/mydomain.com.key;
ssl_session_timeout 30m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
ssl_session_cache shared:SSL:10m;
ssl_prefer_server_ciphers on;
ssl_buffer_size 8k;
ssl_stapling on;
resolver 8.8.8.8;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=31536000;
location / {
root /var/www/mydomain.com/public_html;
access_log /var/log/nginx/mydomaincom.access.log;
error_log /var/log/nginx/mydomaincom.error.log;
}
# ---------------- Grafana
location /mygraf/ {
#rewrite ^(.)$ $1?kiosk last;
#rewrite ^(.
)v61IJiO7z(.*)$ $1/v61IJiO7z/$2?kiosk last;
proxy_pass http://localhost:50001/;
proxy_read_timeout 90;
proxy_ssl_session_reuse on;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
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;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
access_log /var/log/nginx/grf_res.access.log;
error_log /var/log/nginx/grf_res.error.log;
}
}

I would search this forum for issue related to serving Grafana behind Nginx + subpath. there are some good threads with info :+1:

Thanks @mattabrams, the problem is not the subpath, it works great. I just want that when redirect to grafana, the dashboard would be shown in kiosk mode. So I just need to append kiosk at the and of the url. But I’m not able to do it in any way, I think I have done hundreds of different tests, but nothing.
If I try just editing the url with &kiosk at the end, it works great. Even if I’m not login, after do it I have been redirect to the dashboard as kiosk mode
What I’m not able to do is make nginix to add “$kiosk” at the and. That’s it.

1 Like

I really need this, Hoping someone can help me :frowning: :frowning: :frowning:
Thanks to all!