grfana系列文章目录

提示:这里可以添加系列文章的所有文章的目录,目录需要自己手动添加


`配置文件
第五章 grafana使用CDN模式进行页面加速
第六章 nginx代理grafana


前言

在上一章中grafana已经使用CDN模式进行了加速,在这里将把grfana放到后端,一切访问都将通过nginx来访问。


提示:以下是本篇文章正文内容,下面案例可供参考

一、在nginx中添加一个虚拟服务器

这里使用8081 端口对外进行服务
需要注意的是在nginx中独立配置ws的部分,如果没有配置将会发现如下错误:
1) 在浏览器里可以发现:

2) 在nginx的错误日志中:

server {listen       8081;listen  [::]:8081;server_name  192.168.1.122;access_log  /var/log/nginx/host.access.log  main;error_log /var/log/nginx/host.error.log warn;location ^~/api/live {add_header Access-Control-Allow-Origin *;#proxy_http_version 1.1;#proxy_set_header Upgrade $http_upgrade;#proxy_set_header Connection "Upgrade";#proxy_set_header Host $http_host;proxy_http_version 1.1;log_not_found off;proxy_set_header Host $http_host;#proxy_set_header Host $host:$server_port;proxy_set_header X-Real-IP $remote_addr;proxy_redirect off;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";proxy_connect_timeout 10000;proxy_read_timeout 10000; #超时配置一定要proxy_pass http://192.168.1.120:3000/;}location ^~ / {add_header Access-Control-Allow-Origin *;proxy_pass http://192.168.1.120:3000/;}}

二、对于403 forbidden 错误

需要修改granfa的配置文件

[server]
# Protocol (http, https, h2, socket)
protocol = http# The ip address to bind to, empty will bind to all interfaces
;http_addr =# The http port  to use
http_port = 3000# The public facing domain name used to access grafana from a browser
domain = 192.168.1.120  # 这里写入在浏览器中显示的地址# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
enforce_domain = true  # 这里需要从false改成true

nginx 代理grafana相关推荐

  1. Nginx防盗链,Nginx访问控制, Nginx解析php相关配置, Nginx代理

    2019独角兽企业重金招聘Python工程师标准>>> Nginx防盗链 Nginx防盗链配置需要与不记录日志和过期时间结合在一起,因为都用到了location. 打开配置文件,注释 ...

  2. nginx代理响应报文体不全解决思路

    问题说明 环境说明: centos 6.5 nginx 1.13.7 tomcat 8.5+ jdk 1.8 问题描述 本地访问测试机接口发生异常 curl访问结果: tomcat日志: 解决思路 开 ...

  3. FastDFS + Nginx代理方式访问

    FastDFS + Nginx代理方式访问 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.在storage上安装nginx 1>.下载nginx软件(http://ngi ...

  4. go 通过nginx代理后获取用户ip

    go 如果使用自己的服务器,可以直接使用 net/http 来获取 func ip(w http.ResponseWriter, r *http.Request) {fmt.Println(r.Rem ...

  5. nginx代理多个flask

    2019独角兽企业重金招聘Python工程师标准>>> nginx 代理多个flask 本文讲述如何用nginx代理多个flask,从而进行负载均衡 所需准备 : 1. nginx ...

  6. 开发程序实现nginx代理节点状态检查及WEB界面展示

    实现功能介绍: 利用shell程序及http服务巧妙的实现监控nginx代理节点状态检查,然后通过web界面实时刷新显示结果,是不是有些吃惊这样高大上的程序?那就赶紧看看吧! to用人单位:此课程可以 ...

  7. Nginx.代理MySQL

    Nginx.代理MySQL 1. Nginx在安装的时候,需要加上一个参数:--with-stream 即Nginx安装指令为:./configure --prefix=/u01/app/nginx  ...

  8. Nginx防盗链、访问控制、Nginx解析PHP相关配置、Nginx代理

    2019独角兽企业重金招聘Python工程师标准>>> Nginx防盗链 在配置文件里写入以下内容: 用curl测试 访问控制 Nginx限制某些IP不能访问或者只允许某些IP访问. ...

  9. Nginx代理、负载均衡

    Nginx代理 #cd /usr/local/nginx/conf/vhost #vim proxy.conf //加入如下内容 server { listen 80; server_name ask ...

最新文章

  1. libcurl断点下载遇到的问题
  2. 再见Python!Yann LeCun警告:深度学习需要新编程语言
  3. springboot:自动配置原理入门
  4. MyBatis中动态sql的模糊搜索、foreach实现In集合的用法
  5. 用VC写Assembly代码(3)
  6. NoSQL之MongoDB复制集配置、数据导出导入
  7. Android服务器django,从ANDROID-STUDIO客户端与DJANGO服务器交谈
  8. mysql5.6免安装版配置
  9. 图片上传经过jwt_SpringSecurity整合Jwt过程图解
  10. php 开发商城 注意,thinkPHP商城公告功能开发问题分析
  11. 电脑cpu测试软件 95,Prime95(CPU稳定性测试)
  12. October 2019 Twice SQL Injection
  13. Backspace删除键不能够使用的解决办法
  14. 如何理解面向对象(POO)?
  15. php过滤微信表情符号
  16. 小仙女讲JVM(1)—综述
  17. 怎么用python电商文本挖掘?(5)
  18. 关于类的静态的模板函数的使用方式
  19. Android计算器功能的实现
  20. 初等数论 课堂笔记 第二章 -- 费马问题

热门文章

  1. 跨平台的3款epub阅读器推荐
  2. maven在idea中使用junit时,运行要测试的类,提示class not found。
  3. HashMap嵌套HashMap集合
  4. 苹果6信号总是无服务器,苹果6信号不好怎么解决的方法介绍【图文】
  5. python线程锁和进程锁
  6. 几种线程安全的Map解析
  7. 新媒体营销之路该如何走
  8. visio ERROR CODE: 0xC004F009 ERROR DESCRIPTION: The Software Licensing Service reported that the gra
  9. 【一天时间|JavaScript基础】作用域和闭包
  10. Phontoshop快速扣取--图章