Multiple nginx configs in linuxserver/letsencrypt

I have wasted many weeks trying to get proxying to work using /config/nginx/proxy-confs/ in the container linuxserver/letsencrypt. When I finally discovered that there is an /etc/nginx/conf.d I was able to make the proxy work using that.

Why are there two nginx configurations in this image? Furthermore, the NON working one is the one mentioned in the official documentation:

Am I missing something? This was not addressed in any of my searches for the last few weeks in dozens of forum postings on this setup. I have tried multiple container images using letsencrypt and all seem to have this same two setups–which makes sense if they are based on the letsencrypt image.

Thank you for anyone who can shed some light on this.

Pretty sure you’re missing something or changed the config incorrectly.

You have absolutely no need to use /etc/nginx/conf.d

any idea why there are two? How are the two related?

Seems that both are running at the same time. I can run sites on various ports and them them to work in /etc/nginx/conf.d which makes sense I guess but why is it there?

BTW I had the file name incorrect in /config/nginx/proxy-confs. Finally figured that out that I needed the literal string ‘subdomain’. I thought that was a placeholder and that I was supposed to use my own subdomain: e.g. abc.conf should be abc.subdomain.conf

Oh no, the filename matters, because that’s how we distinguish between subdomain and subfolder proxy confs. They get included in different spots.

The documentation is clear on that, it tells you to only remove the .sample from the end to enable.

I’m not enabling existing configs. I’m proxying to my own sites/applications.

A more intuitive approach to the subdomain/subfolder layout might be:

/config/nginx/proxy-confs/subdomain/*.conf
/config/nginx/proxy-confs/subfolder/*.conf

I’m guessing you’re referring to the /etc/nginx/conf.d folder? That’s just the system default location for additional nginx confs. But we don’t use it because it is inside the container and doesn’t survive container recreation

Well, you’re not using it the way it was intended. You’re creating your own site confs. So either put them in the /config/nginx/site-confs, or you can piggy back on the system we created, but you have to stick to the same format (which would be a hack, a useful one but a hack nonetheless)

put them in the /config/nginx/site-confs

Thank you for that clarification. I was trying to follow the conventions of the system. The docs–which I will paste below-- led me to believe that I should put proxy related configs in the proxy-confs folder. Perhaps the docs could be a little more clear (don’t put your own configs here.) or something similar in the second bullet point.

Anyway, this is now searchable information. Hope it helps someone else.

from docker-letsencrypt/README.md at master · linuxserver/docker-letsencrypt · GitHub

  • The default site config resides at /config/nginx/site-confs/default . Feel free to modify this file, and you can add other conf files to this directory. However, if you delete the default file, a new default will be created on container start.
  • Preset reverse proxy config files are added for popular apps. See the README.md file under /config/nginx/proxy_confs for instructions on how to enable them. The preset confs reside in and get imported from this repo.