nginx as proxy using a specific source ip
proxy_bind directive allows you to choose different source IP address.
http://wiki.nginx.org/HttpProxyModule#proxy_bind
So your configuration would look like:
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
location /integracao/ {
proxy_bind A.A.A.A;
proxy_pass http://X.X.X.X:9080/integracao/;
}
location /solr/ {
proxy_bind B.B.B.B;
proxy_pass http://Y.Y.Y.Y:8080/solr/;
}
if nginx cannot do it you can always use netfilter and SNAT to make it appear like nginx was using specific ip:
iptables -t nat -A POSTROUTING -p tcp --dport 9080 -d ip_of_your_backend -j SNAT --to one_of_ips_bound_to_nginx_server