Merging https://github.com/jwilder/nginx-proxy/pull/774 and https://github.com/jwilder/nginx-proxy/commit/a8ee64b0596ffc0a8df369e88d1115b80afb04fa