Ad Widget

Collapse

Proxy Agent Requests

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ekefar
    Junior Member
    • Jan 2019
    • 1

    #1

    Proxy Agent Requests

    Hello,

    I'm trying to set up Zabbix agents in a private network that restricts outbound connection to any ports other than 80 and 443. My Zabbix server is located outside of that network. And since it's listening port 10051 agents can't connect. I guess configuring it to listen port 80 would be a bad decision since it's a standard HTTP port and it's already taken by a built-in Apache server that serves Zabbix front-end.

    I tried configuring an Nginx on a separate server that would proxy all requests to port 10051 of my Zabbix server, but it didn't work. Here are the logs and my Nginx config:


    zabbix_agentd.log
    Code:
    22255:20190104:143749.002 cannot parse list of active checks: cannot parse as a valid JSON object: invalid object format, expected opening character '{' at: 'HTTP/1.1 400 Bad Request
    Server: nginx/1.10.3 (Ubuntu)
    Date: Fri, 04 Jan 2019 14:37:48 GMT
    Content-Type: text/html
    Content-Length: 182
    Connection: close

    Nginx access.log
    Code:
    [04/Jan/2019:14:27:48 +0000] "ZBXD\x01" 400 182 "-" "-"
    [04/Jan/2019:14:29:48 +0000] "ZBXD\x01" 400 182 "-" "-"
    [04/Jan/2019:14:31:48 +0000] "ZBXD\x01" 400 182 "-" "-"
    [04/Jan/2019:14:33:48 +0000] "ZBXD\x01" 400 182 "-" "-"
    [04/Jan/2019:14:35:48 +0000] "ZBXD\x01" 400 182 "-" "-"
    [04/Jan/2019:14:37:49 +0000] "ZBXD\x01" 400 182 "-" "-"

    Nginx config
    Code:
    server {
            listen 80;
            location / {
                    proxy_pass http://34.207.203.97:10051;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header Host $host;
                    proxy_set_header Accept-Encoding "";
            }
    }

    Any ideas on how to fix this? Or is there any standard approach to handling such cases?

    Thank you in advance!
Working...