dify icon indicating copy to clipboard operation
dify copied to clipboard

Support `NGINX_ENABLED` Environment Variable

Open comfuture opened this issue 1 year ago • 3 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [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.

comfuture avatar Jan 21 '25 07:01 comfuture

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] avatar Feb 21 '25 16:02 dosubot[bot]

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

allgameplaya avatar Feb 24 '25 22:02 allgameplaya

@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] avatar Feb 24 '25 22:02 dosubot[bot]