Why is nginx mirror receiving duplicates?

Hello,

I have setup a simple mirroring test with nginx. The requests are mirrored to my test server. However the requests are mirrored twice. What am I doing wrong? If I understand correctly they should only be received once.

NGINX:
location / {
    mirror /test;
    root /usr/local/www/nginx;
    index index.html index.htm;
}

location /test {
    internal;
    proxy_pass http://127.0.0.1:3000;
}

Start server:
Bash:
ncat -k -l 127.0.0.1 3000

Make request:
Bash:
curl localhost

Response of ncat mirror server:
Bash:
GET /test HTTP/1.0
Host: 127.0.0.1:3000
Connection: close
User-Agent: curl/7.87.0
Accept: */*

GET /test HTTP/1.0
Host: 127.0.0.1:3000
Connection: close
User-Agent: curl/7.87.0
Accept: */*
 
ifconfig -a obviously gives a lot of lines.
Only relevant I see is:
Bash:
inet 127.0.0.1 netmask 0xff000000
Relevant sockstat lines. Apparently there were two listeners on port 3000?...
However after a second run the lines beneath disappeared.
Bash:
?        ?          ?     ?  tcp4   127.0.0.1:62334       127.0.0.1:80
?        ?          ?     ?  tcp4   127.0.0.1:3000        127.0.0.1:56898
?        ?          ?     ?  tcp4   127.0.0.1:3000        127.0.0.1:58674

Sockstat -l4 shows two listeners for nginx, but nothing for ncat
Bash:
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      
www      nginx      96400 6  tcp4   127.0.0.1:80          *:*
root     nginx      96399 6  tcp4   127.0.0.1:80          *:*
 
Back
Top