Adicione um segundo bloco de localização. Ele corresponderá a qualquer caminho, exceto /track.gif.
upstream tracker {
server 127.0.0.1:8888;
}
server {
listen 0.0.0.0:80;
server_name www.domain.com domain.com;
access_log /var/log/nginx/domain_access.log;
error_log /var/log/nginx/domain_error.log;
location /track.gif {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://tracker;
proxy_redirect off;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:3000;
proxy_redirect off;
}