Apache Gitlab中嵌入的Grafana无法通过反向代理工作
尝试访问url时(以管理员身份):我遇到404页面未找到错误 因此,当尝试访问Grafana monitoring(通过GitLab提供)实例时,我会遇到一个404页面未找到错误 Grafana正在端口3000上运行,因此Apache Gitlab中嵌入的Grafana无法通过反向代理工作,apache,gitlab,reverse-proxy,grafana,Apache,Gitlab,Reverse Proxy,Grafana,尝试访问url时(以管理员身份):我遇到404页面未找到错误 因此,当尝试访问Grafana monitoring(通过GitLab提供)实例时,我会遇到一个404页面未找到错误 Grafana正在端口3000上运行,因此curl localhost:3000输出: 我已经尝试将以下位置块添加到我的Apache配置中 <Location /-/grafana> ProxyPassReverse http://127.0.0.1:3000/ </Location>
curl localhost:3000
输出:
我已经尝试将以下位置块添加到我的Apache配置中
<Location /-/grafana>
ProxyPassReverse http://127.0.0.1:3000/
</Location>
ProxyPassReversehttp://127.0.0.1:3000/
及
ProxyPasshttp://127.0.0.1:3000
ProxyPassReversehttp://127.0.0.1:3000
以下是我的apache配置:
<VirtualHost *:80>
ServerName gitlab.domain.com
ServerSignature Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
<Location />
Require all granted
ProxyPassReverse http://127.0.0.1:8181
ProxyPassReverse http://example.com/
</Location>
RewriteEngine on
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
RewriteCond %{SERVER_NAME} =gitlab.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
ServerName gitlab.domain.com
服务器签名关闭
代理主机
AllowEncodeDSL节点代码
要求所有授权
ProxyPassReversehttp://127.0.0.1:8181
ProxyPassReversehttp://example.com/
重新启动发动机
DocumentRoot/opt/gitlab/embedded/service/gitlab-rails/public
RewriteCond%{SERVER_NAME}=gitlab.example.com
重写规则^https://%{SERVER_NAME}%{REQUEST_URI}[END,NE,R=permanent]
对于https:
<IfModule mod_ssl.c>
SSLStaplingCache shmcb:/var/run/apache2/stapling_cache(128000)
<VirtualHost *:443>
ServerName gitlab.example.com
ServerSignature Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
<Location />
Require all granted
ProxyPassReverse http://127.0.0.1:8181
ProxyPassReverse http://example.com/
</Location>
RequestHeader set Host "gitlab.example.com"
RequestHeader add X-Forwarded-Ssl on
RequestHeader set X-Forwarded-Proto "https"
RewriteEngine on
#Forward all requests to gitlab-workhorse except existing files like error documents
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_URI} ^/uploads/.*
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
</VirtualHost>
</IfModule>
SSLStaplingCache shmcb:/var/run/apache2/stapling_缓存(128000)
ServerName gitlab.example.com
服务器签名关闭
代理主机
AllowEncodeDSL节点代码
要求所有授权
ProxyPassReversehttp://127.0.0.1:8181
ProxyPassReversehttp://example.com/
RequestHeader设置主机“gitlab.example.com”
RequestHeader在上添加X-Forwarded-Ssl
RequestHeader集合X-Forwarded-Proto“https”
重新启动发动机
#将所有请求转发到gitlab workhorse,但现有文件(如错误文档)除外
重写cond%{DOCUMENT\u ROOT}/%{REQUEST\u FILENAME}-f[或]
RewriteCond%{REQUEST_URI}^/uploads/*
重写规则。*http://127.0.0.1:8181%{REQUEST_URI}[P,QSA]
DocumentRoot/opt/gitlab/embedded/service/gitlab-rails/public
不幸的是,这两个位置块都不起作用。我已经在端口80 apache配置和端口443配置中放置了这两个块,但仍然停留在404错误页面上
<IfModule mod_ssl.c>
SSLStaplingCache shmcb:/var/run/apache2/stapling_cache(128000)
<VirtualHost *:443>
ServerName gitlab.example.com
ServerSignature Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
<Location />
Require all granted
ProxyPassReverse http://127.0.0.1:8181
ProxyPassReverse http://example.com/
</Location>
RequestHeader set Host "gitlab.example.com"
RequestHeader add X-Forwarded-Ssl on
RequestHeader set X-Forwarded-Proto "https"
RewriteEngine on
#Forward all requests to gitlab-workhorse except existing files like error documents
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_URI} ^/uploads/.*
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
</VirtualHost>
</IfModule>