用centos服务器通过docker部署grafana服务后,需要做域名来访问这个服务
需要nginx反向代理,修改配置后怎么都不成功,访问502错误
反向代理可以通过修改nginx.conf配置文件,新增一个新目录指向或添加在con.d文件夹下
server { listen 80; listen [::]:80; root /var/www/html; index index.html index.htm index.nginx-debian.html; server_name eng.xxx.com; location / { proxy_pass http://10.1.0.32:3000; proxy_set_header Host $http_host; } }
日志提示
2024/03/21 11:55:55 [crit] 11408#11408: *5 connect() to 10.1.0.32:3000 failed (13: Permission denied) while connecting to upstream, client: 10.1.0.5, server: eng.xxx.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://10.1.0.32:3000/favicon.ico", host: "mon.eng.slamtec.com", referrer: "http://eng.xxx.com/"
通过设置selinux解决
增加
setsebool -P httpd_can_network_connect 1
或临时关闭selink测试
setenforce 0