Support NGINX_ENABLED Environment Variable #7816

Closed
opened 2026-02-21 18:22:31 -05:00 by yindo · 3 comments
Owner

Originally created by @comfuture on GitHub (Jan 21, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

When using Docker to run Dify, an Nginx container is launched. This container provides a reverse proxy for API and web, and, depending on the options, it supports HTTPS and certbot certificate renewal, making it convenient.
However, by default, EXPOSE_NGINX_PORT and EXPOSE_NGINX_SSL_PORT are set to 80 and 443 respectively, and the ports mapping of the Nginx service is mapped to ports 80 and 443 of the host machine, which can lead to conflicts with the host machine's already running Nginx.

If you want to set up a direct Nginx reverse proxy along with other services running on the host machine, changing the EXPOSE ports to arbitrary values that are not in use will solve the issue, but the unused Nginx Docker container will still be running.

Proposal

Introduce an option: NGINX_ENABLED: ${NGINX_ENABLED:-false}
and provide a choice to not use Nginx.

I believe this change will give more flexibility to the deployment environment using Docker.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @comfuture on GitHub (Jan 21, 2025). ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. When using Docker to run Dify, an Nginx container is launched. This container provides a reverse proxy for API and web, and, depending on the options, it supports HTTPS and certbot certificate renewal, making it convenient. However, by default, `EXPOSE_NGINX_PORT` and `EXPOSE_NGINX_SSL_PORT` are set to `80` and `443` respectively, and the ports mapping of the Nginx service is mapped to ports `80` and `443` of the host machine, which can lead to conflicts with the host machine's already running Nginx. If you want to set up a direct Nginx reverse proxy along with other services running on the host machine, changing the EXPOSE ports to arbitrary values that are not in use will solve the issue, but the unused Nginx Docker container will still be running. ## Proposal Introduce an option: `NGINX_ENABLED: ${NGINX_ENABLED:-false}` and provide a choice to not use Nginx. I believe this change will give more flexibility to the deployment environment using Docker. ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:22:31 -05:00
yindo closed this issue 2026-02-21 18:22:31 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 21, 2025):

Hi, @comfuture. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • Proposal to add a NGINX_ENABLED environment variable to the Docker setup.
  • Aims to prevent port conflicts with existing Nginx setups on host machines.
  • No further comments or activity since the issue was opened.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting here.
  • If there is no further activity, the issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Feb 21, 2025): Hi, @comfuture. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - Proposal to add a `NGINX_ENABLED` environment variable to the Docker setup. - Aims to prevent port conflicts with existing Nginx setups on host machines. - No further comments or activity since the issue was opened. **Next Steps:** - Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting here. - If there is no further activity, the issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Author
Owner

@allgameplaya commented on GitHub (Feb 24, 2025):

I think this is great idea. I've been having issues with Nginvx Proxy Manager and Dify. They do not play well together.

@allgameplaya commented on GitHub (Feb 24, 2025): I think this is great idea. I've been having issues with Nginvx Proxy Manager and Dify. They do not play well together.
Author
Owner

@dosubot[bot] commented on GitHub (Feb 24, 2025):

@takatost, the user has indicated that the issue regarding the NGINX_ENABLED environment variable is still relevant, especially due to conflicts with Nginx Proxy Manager. Could you please assist them with this?

@dosubot[bot] commented on GitHub (Feb 24, 2025): @takatost, the user has indicated that the issue regarding the `NGINX_ENABLED` environment variable is still relevant, especially due to conflicts with Nginx Proxy Manager. Could you please assist them with this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7816