pinpoint collector nginx 配置

nginx版本:1.12.1
下面的collector1和collector2替换为部署collector具体的ip
web1和web2替换为部署web的具体的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;
        }
    }
}

你可能感兴趣的:(pinpoint)