Hi! I was having the same issue and i found this post through google.
I have found a way to make it work but it’s not the correct one. I will give my way and hope someone can help us both fix it haha.
I am running a docker compose file in my raspberry pi to host my domain’s website + let’s encrypt certificates.
The docker compose file has the budry/jwilder-nginx-proxy-arm, duch/letsencrypt-nginx-proxy-companion:stable and nginx images (the full compose file is from a spanish youtuber hosted in https://github.com/pablokbs/peladonerd/blob/master/raspi/7/docker-compose.yaml ).
What I did was run the compose, copy the /etc/nginx/conf.d/default.conf from the nginx_proxy container to the pi with the command
docker cp containerid:/etc/nginx/conf.d/default.conf .
edit it with vim or nano and add the www.domain.com next to my domain.com in both server_name lines in the file and copy the file back to the container. Then enter into the container with the command
docker exec -it containerid /bin/bash
and once inside the container I run the command
nginx -s reload
Then i checked the www.domain.com and worked perfectly.
The only problem now is that this change isn’t persistent and when I run the docker compose file again, the /etc/nginx/conf.d/default.conf gets rewritten and the www.domain.com isn’t next to the domain.com in the servername line. Do you think how can i make docker nginxproxy file not rewrite it? It might be the solution for the both of us hopefully.
Thanks and hope it works with you as well!