eugene-khyst / letsencrypt-docker-compose

Set up Nginx and Let’s Encrypt in less than 3 minutes with a Docker Compose project that automatically obtains and renews free Let's Encrypt SSL/TLS certificates and sets up HTTPS in Nginx for multiple domain names. Configuration is done using a simple CLI tool.
Apache License 2.0
473 stars 218 forks source link

Default network is `letsencrypt-docker-compose_default` missing from docs #38

Closed tka85 closed 1 year ago

tka85 commented 1 year ago

Seems it's worth mentioning in the docs that the default setup creates network letsencrypt-docker-compose_default for all its containers. This proves useful given that the initialization script offers for Reverse proxy the option to Proxy to a server defined in the same docker-compose.yml (y/n).

In my case the service to which the reverse proxy relays requests is in a separate docker-compose.yml and has its own network. But even if it doesn't have its own network, it's worth mentioning that in that case my own services should be configured to use the letsencrypt-docker-compose_default network.

eugene-khyst commented 1 year ago

Thanks for the suggestion. I will extend the README to describe the situation when the upstream is located in another docker-compose.yml. Another option will be to expose the upstream through some port and configure Nginx upstream as server host.docker.internal:{{port}}.

tka85 commented 1 year ago

Also worth mentioning that the location section of nginx-conf/conf.d/mydomain.com.conf in this case will need to have additionally:

resolver 127.0.0.11;

eugene-khyst commented 1 year ago

Resolver 127.0.0.11 is added automatically if answer Yes to the question

Proxy to a server defined in the same docker-compose.yml (y/n)

tka85 commented 1 year ago

But it is needed as well if the answer to this question is No.

Without it, even being in the same network, nginx couldn't find the container where to forward the requests simply using its name.

Error was no resolver defined to resolve....

eugene-khyst commented 1 year ago

Updated the README and pushed a fix to the CLI tool. Rebuild the CLI tool after pulling the latest updates: docker compose build cli.