0987iu 发表于 2017-1-20 09:06:27

Zabbix 使用nginx做web服务

zabbix 使用nginx做web服务

逻辑图:


yumnginx装好,默认的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 _;
    indexindex.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
$ cat zabbix34.ops.com.conf
server {
      listen       80;
      server_namezabbix34.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;
      }
}






页: [1]
查看完整版本: Zabbix 使用nginx做web服务