I am trying to mirror the SNMP trap across multiple servers. It uses TCP/IP traffic. I am using nginx to complete this but i am getting the following error
vsrsadmin@TRAP02:~$ sudo nginx -t
nginx: [emerg] "location" directive is not allowed here in /etc/nginx/nginx.conf:118
nginx: configuration file /etc/nginx/nginx.conf test failed
stream{
upstream dns_servers {
least_conn;
server 192.168.49.19:162 max_fails=1 fail_timeout=30s;
}
upstream mir_dns_servers {
least_conn;
server 192.168.49.15:162 max_fails=1 fail_timeout=30s;
}
#}
server {
listen 162;
# proxy_bind $remote_addr:$remote_port transparent;
# proxy_pass dns_servers;
location / {
mirror /mirror;
mirror_request_body on;
proxy_pass dns_servers;
}
location = /mirror {
mirror /mirror;
mirror_request_body on;
proxy_pass mir_dns_servers;
proxy_connect_timeout 200ms;
proxy_read_timeout 200ms;