Provide reproducible example (config) + error (e.g. screenshot, browser console requests, …) - make sure you run CTRL+F5 a few times (reload without caching any resources) in your browser - you you have 100% current config in the browser.
The reproducible example is provided in the code snippets. I’m re-deploying it using docker compose, so the config is always fresh because it gets re-deployed. The code snippets above are everything needed to reproduce it. The examples just miss index.html which is a dummy static hello world page.
That’s config. But files in the browser are cached and you don’t consider that a problem.
Your browser loads js/css files, which are expecting grafana on grafanahost:3000 and then you change config to subpath grafanahost:3000/subath and redeploy it with docker-compose. Your browser may still have cached old js/css files grafanahost:3000, so cache clearing is IMPORTANT. You will see it in the browser console where files are pointing - if it is pointing to subpath or not
I asked for repo. You as a requester should make the easiest way to support you otherwise you will decrease the chance for help. What is the point of community supporters spending an hour just to setup everything and you will pay a minute to write about problem?
There are no changes, which I suggested. Sorry, provide me a repo with exact setup, which I suggested and which didn’t work for you.
You said that this is not working, so I asked for exactly this reproducible example.
You provided now repo with vanilla config - there is no config for “Configure Grafana for subpath and then also connect to subpath from nginx”. So from my point of view you didn’t follow my instructions. I’m happy to help if you follow instructions.
Ok, thanks, indeed the code in the repo was wrong. But do I follow correctly from
Configure Grafana for subpath and then also connect to subpath from nginx
proxy_pass http://grafana:3000/grafana/;
All gears must be working with that subpath
that it is not possible to redirect /grafana → http://grafana:3000 (without the subpath)? Because this is what actually I want to do: to use nginx to redirect from some arbitrary path to Grafana under some address.
I guess it’s possible, but then you may need a billion rewrites/content rewrites to fix the redirect.
Your current setup is almost OK. Configure Grafana to the same port as nginx 80. So Grafana generates all redirects in the same config as nginx expect.