Use an upstream block instead of the container name directly
upstream backend {
server container1;
}
server {
location ~ ^/some_url/(.*)$ {
proxy_pass http://backend/$1;
}
}
This should allow normal name resolution to occur providing a way to easily use docker links with nginx.