mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 17:06:57 -06:00
More fixes for relative urls when running Grafana under a different sub path (#10470)
* Add nginx proxy docker container Ease test/verification of running Grafana thru a reverse proxy * Add apache proxy docker container Ease test/verification of running Grafana thru a reverse proxy * Fix relative urls for reset password page * Fix relative urls for signup page * Fix relative urls for login page * Fix relative urls edit plugin page
This commit is contained in:
parent
776d17458b
commit
3ecec8e0d2
4
docker/blocks/apache_proxy/Dockerfile
Normal file
4
docker/blocks/apache_proxy/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM jmferrer/apache2-reverse-proxy:latest
|
||||
|
||||
COPY ports.conf /etc/apache2/sites-enabled
|
||||
COPY proxy.conf /etc/apache2/sites-enabled
|
9
docker/blocks/apache_proxy/docker-compose.yaml
Normal file
9
docker/blocks/apache_proxy/docker-compose.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
# This will proxy all requests for http://localhost:10081/grafana/ to
|
||||
# http://localhost:3000 (Grafana running locally)
|
||||
#
|
||||
# Please note that you'll need to change the root_url in the Grafana configuration:
|
||||
# root_url = %(protocol)s://%(domain)s:/grafana/
|
||||
|
||||
apacheproxy:
|
||||
build: blocks/apache_proxy
|
||||
network_mode: host
|
1
docker/blocks/apache_proxy/ports.conf
Normal file
1
docker/blocks/apache_proxy/ports.conf
Normal file
@ -0,0 +1 @@
|
||||
Listen 10081
|
4
docker/blocks/apache_proxy/proxy.conf
Normal file
4
docker/blocks/apache_proxy/proxy.conf
Normal file
@ -0,0 +1,4 @@
|
||||
<VirtualHost *:10081>
|
||||
ProxyPass /grafana/ http://localhost:3000/
|
||||
ProxyPassReverse /grafana/ http://localhost:3000/
|
||||
</VirtualHost>
|
3
docker/blocks/nginx_proxy/Dockerfile
Normal file
3
docker/blocks/nginx_proxy/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
9
docker/blocks/nginx_proxy/docker-compose.yaml
Normal file
9
docker/blocks/nginx_proxy/docker-compose.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
# This will proxy all requests for http://localhost:10080/grafana/ to
|
||||
# http://localhost:3000 (Grafana running locally)
|
||||
#
|
||||
# Please note that you'll need to change the root_url in the Grafana configuration:
|
||||
# root_url = %(protocol)s://%(domain)s:/grafana/
|
||||
|
||||
nginxproxy:
|
||||
build: blocks/nginx_proxy
|
||||
network_mode: host
|
19
docker/blocks/nginx_proxy/nginx.conf
Normal file
19
docker/blocks/nginx_proxy/nginx.conf
Normal file
@ -0,0 +1,19 @@
|
||||
events { worker_connections 1024; }
|
||||
|
||||
http {
|
||||
sendfile on;
|
||||
|
||||
proxy_redirect off;
|
||||
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-Host $server_name;
|
||||
|
||||
server {
|
||||
listen 10080;
|
||||
|
||||
location /grafana/ {
|
||||
proxy_pass http://localhost:3000/;
|
||||
}
|
||||
}
|
||||
}
|
@ -17,7 +17,7 @@ export class ResetPasswordCtrl {
|
||||
main: {
|
||||
icon: 'gicon gicon-branding',
|
||||
subTitle: 'Reset your Grafana password',
|
||||
breadcrumbs: [{ title: 'Login', url: '/login' }, { title: 'Reset Password' }],
|
||||
breadcrumbs: [{ title: 'Login', url: 'login' }, { title: 'Reset Password' }],
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -22,7 +22,7 @@ export class SignUpCtrl {
|
||||
main: {
|
||||
icon: 'gicon gicon-branding',
|
||||
subTitle: 'Register your Grafana account',
|
||||
breadcrumbs: [{ title: 'Login', url: '/login' }, { title: 'Sign Up' }],
|
||||
breadcrumbs: [{ title: 'Login', url: 'login' }, { title: 'Sign Up' }],
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,7 @@ export class PluginEditCtrl {
|
||||
subTitle: model.info.author.name,
|
||||
url: '',
|
||||
text: '',
|
||||
breadcrumbs: [{ title: 'Plugins', url: '/plugins' }, { title: model.name }],
|
||||
breadcrumbs: [{ title: 'Plugins', url: 'plugins' }, { title: model.name }],
|
||||
children: [
|
||||
{
|
||||
icon: 'fa fa-fw fa-file-text-o',
|
||||
|
@ -63,7 +63,7 @@
|
||||
<div class="login-signup-title p-r-1">
|
||||
New to Grafana?
|
||||
</div>
|
||||
<a href="/signup" class="btn btn-medium btn-signup btn-p-x-2">
|
||||
<a href="signup" class="btn btn-medium btn-signup btn-p-x-2">
|
||||
Sign Up
|
||||
</a>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<button type="submit" class="btn btn-success" ng-click="sendResetEmail();" ng-disabled="!sendResetForm.$valid">
|
||||
Reset Password
|
||||
</button>
|
||||
<a href="/login" class="btn btn-inverse">
|
||||
<a href="login" class="btn btn-inverse">
|
||||
Back
|
||||
</a>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
An email with a reset link as been sent to the email address. <br>
|
||||
You should receive it shortly.
|
||||
<div class="p-t-1">
|
||||
<a href="/login" class="btn btn-success p-t-1">
|
||||
<a href="login" class="btn btn-success p-t-1">
|
||||
Login
|
||||
</a>
|
||||
</div>
|
||||
|
@ -40,7 +40,7 @@
|
||||
<button type="submit" class="btn btn-success" ng-click="ctrl.submit();" ng-disabled="!signUpForm.$valid">
|
||||
Sign Up
|
||||
</button>
|
||||
<a href="/login" class="btn btn-inverse">
|
||||
<a href="login" class="btn btn-inverse">
|
||||
Back
|
||||
</a>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user