Docker Compose certbot + nginx SSL support #198

Closed
opened 2026-02-21 17:26:20 -05:00 by yindo · 4 comments
Owner

Originally created by @roberteles on GitHub (Jun 20, 2023).

Originally assigned to: @takatost, @crazywoola on GitHub.

Hello @takatost and @crazywoola!

Is your feature request related to a problem? Please describe.
We're trying to host Dify on our server, but seem to have issues getting the SSL configured.

Describe the solution you'd like
I would like to ask setting up the Docker Compose file to support Certbot & the nginx to support SSL

Describe alternatives you've considered
We tried taking the responsibility of nginx on our side (and configure things at the server level instead of docker) similarly to https://github.com/langgenius/dify/issues/426, but we ran into issues where the app (Dify) wasn't aware of the different docker containers on a network level.

Many thanks!

Originally created by @roberteles on GitHub (Jun 20, 2023). Originally assigned to: @takatost, @crazywoola on GitHub. Hello @takatost and @crazywoola! **Is your feature request related to a problem? Please describe.** We're trying to host Dify on our server, but seem to have issues getting the SSL configured. **Describe the solution you'd like** I would like to ask setting up the Docker Compose file to support Certbot & the nginx to support SSL **Describe alternatives you've considered** We tried taking the responsibility of nginx on our side (and configure things at the server level instead of docker) similarly to https://github.com/langgenius/dify/issues/426, but we ran into issues where the app (Dify) wasn't aware of the different docker containers on a network level. Many thanks!
yindo added the 🙏 help wanted label 2026-02-21 17:26:20 -05:00
yindo closed this issue 2026-02-21 17:26:20 -05:00
Author
Owner

@bhctest123 commented on GitHub (Jun 23, 2023):

Hey @takatost @crazywoola, the lack of SSL support prevents anyone serious about using dify self-hosted in production from actually deploying it. This is a must have capability for any business.

I had assumed that any open-source project would be focused on supporting these self-hosted users to have realistic real world usage to drive broad adoption. This is key to building a large open source community. There is so much activity in LLMs that its already challenging to pick the right projects to follow and contribute too. SSL issue is forcing the decision.

If this is not a real goal of the project then its just a hosted solution with no path to real self-hosting. I really want Dify to succeed, but I cannot invest much more time or effort into a project with no path to my goals.

Every other feature for Self-hosting depends on an working SSL cert. No one will build on an unencrypted LLM product, it makes no sense. We burned a few hours on trying to solve this already, but it is not realistic for an non-core member to solve this issue.

Can someone please clarify this issue?

@bhctest123 commented on GitHub (Jun 23, 2023): Hey @takatost @crazywoola, the lack of SSL support prevents anyone serious about using dify self-hosted in production from actually deploying it. This is a must have capability for any business. I had assumed that any open-source project would be focused on supporting these self-hosted users to have realistic real world usage to drive broad adoption. This is key to building a large open source community. There is so much activity in LLMs that its already challenging to pick the right projects to follow and contribute too. SSL issue is forcing the decision. If this is not a real goal of the project then its just a hosted solution with no path to real self-hosting. I really want Dify to succeed, but I cannot invest much more time or effort into a project with no path to my goals. Every other feature for Self-hosting depends on an working SSL cert. No one will build on an unencrypted LLM product, it makes no sense. We burned a few hours on trying to solve this already, but it is not realistic for an non-core member to solve this issue. Can someone please clarify this issue?
Author
Owner

@crazywoola commented on GitHub (Aug 4, 2023):

@takatost

@crazywoola commented on GitHub (Aug 4, 2023): @takatost
Author
Owner

@bhctest123 commented on GitHub (Aug 7, 2023):

@takatost @crazywoola we figured this out. thank you guys for work so hard on Dify, we appreciate you all!

@bhctest123 commented on GitHub (Aug 7, 2023): @takatost @crazywoola we figured this out. thank you guys for work so hard on Dify, we appreciate you all!
Author
Owner

@roberteles commented on GitHub (Aug 7, 2023):

I managed to get it working by following the next steps:

  • changed the default port that dify uses from :80 to something else (eg. :8082). This has to be done both in docker/docker-compose.yaml and in the docker/nginx/conf.d/default.conf files
  • configured a local nginx server, taking over the :80 port
  • used certbot to get certificate from letsencrypt
  • updated nginx to proxy all :80 requests to :8082
  • updated nginx to proxy all :443 to :80
  • updated ENV variables from docker-compose.yaml to use https:// instead of http://
@roberteles commented on GitHub (Aug 7, 2023): I managed to get it working by following the next steps: - changed the default port that dify uses from `:80` to something else (eg. `:8082`). This has to be done both in `docker/docker-compose.yaml` and in the `docker/nginx/conf.d/default.conf` files - configured a local nginx server, taking over the `:80` port - used certbot to get certificate from letsencrypt - updated nginx to proxy all `:80` requests to `:8082` - updated nginx to proxy all `:443` to `:80` - updated ENV variables from `docker-compose.yaml` to use `https://` instead of `http://`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#198