本文共 1076 字,大约阅读时间需要 3 分钟。
zabbix 使用nginx做web服务
逻辑图:
yum nginx装好,默认的default.conf文件直接backup掉,新建一个zabbx.conf文件,
#如果有报错看下nginx_log 日志排错,zabbix3.0.4nginx转发依赖./php-fpm -v
PHP 5.6.25,之前代理发现没用 报错也不是配置错误,查看官网发现是php-fpm版本问题。
10.10.254.25 zabbix_server服务器nginx配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 | $ cat zabbix.conf server { listen 80; server_name _; index index.html index.php; root /usr/local/nginx/html ; location ~ .*\.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } |
}
外网机器做代理zabbix_server nginx(这里面的域名我已经改了,不要去尝试):
10.10.1.7nginx代理的配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [ops]$ cat zabbix34.ops.com.conf server { listen 80; server_name zabbix34.ops.com; allow 116.226.224.120 /32 ; allow 180.167.73.37 /32 ; allow 116.231.211.167 /32 ; deny all; #zabbix3.0.4 location / { proxy_pass http: //10 .10.254.25/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } |
转载地址:http://qxukx.baihongyu.com/