See https://stackoverflow.com/a/24521632/1760643.
I have an issue when redirects lead to TARGET_HOST not to DOMAIN.
Solved it:
> docker exec -it {NGINX_SSL_PROXY_CONTAINER_NAME} sh
# vi /etc/nginx/nginx.conf
inside the
block I added
proxy_redirect http://{TARGET_HOST} https://{DOMAIN}:{SSL_PORT};
(you need to replace {TARGET_HOST} etc with your values)
Then
# nginx -s reload