I don’t know if anyone has indicated this as a problem on GitHub yet but if you setup a site like example.com the redirect settings for the www subdomain doesn’t get set. The easiest way to do this is to turn on SSL for your domain. It will make a second config file for your nginx proxy called example.com-redirect.conf which will handle the www redirect.
You could attempt to go directly to the docker’s config folder and make your own. Not 100% sure that will work but it is a simple enough fix to turn on SSL and recommended no matter the content of your site.
/var/lib/docker/volumes/global-nginx-proxy_confd/_data
This is some example code from that redirect file.
server {
listen 80;
server_name www.example.com;
return 301 http://example.com$request_uri;
}
If you aren’t planning to use SSL then use the settings above or just enable SSL and it will create the correct redirect file for you.