pinpoint 컬렉터 nginx 설정

6196 단어 pinpoint
nginx 버 전: 1.12.1 아래 의 collector 1 과 collector 2 는 collector 를 배치 하 는 구체 적 인 ip web 1 과 web 2 를 배치 웹 의 구체 적 인 ip 로 교체 합 니 다.
worker_processes  16;
error_log  logs/error.log;
pid        logs/nginx.pid;
events {
    worker_connections  65535;
}
stream {
    log_format main '$remote_addr [$time_local] '
                 '$protocol $status $bytes_sent $bytes_received '
                 '$session_time "$upstream_addr" '
                 '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';
    access_log  logs/access.log  main;

    upstream 9995_udp_upstreams {
        server collector1:9995 max_fails=3 fail_timeout=30s;
        server collector2:9995 max_fails=3 fail_timeout=30s;
    }

    upstream 9996_udp_upstreams {
        server collector1:9996  max_fails=3 fail_timeout=30s;
        server collector2:9996  max_fails=3 fail_timeout=30s;
    }

    upstream 9994_tcp_upstreams {
        server collector1:9994 max_fails=3 fail_timeout=30s;
        server collector2:9994 max_fails=3 fail_timeout=30s;
    }

    server {
        listen 9995 udp;
        proxy_pass 9995_udp_upstreams;
        proxy_timeout 10s;
    }

    server {
        listen 9996 udp;
        proxy_pass 9996_udp_upstreams;
        proxy_timeout 10s;
    }

    server {
        listen 9994 so_keepalive=on;
        proxy_pass 9994_tcp_upstreams;
    }
 }

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }

    upstream pinpoint{
            server web1:8080;
            server web2:8080;
    }
    server {
        listen       80;
        server_name  trace.xxx.com;

        location / {
             proxy_pass http://pinpoint;
        }
        location /agent {
                proxy_pass http://pinpoint;

                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

좋은 웹페이지 즐겨찾기