Access address display issue when using external Nginx reverse proxy to access dify docker nginx #12053

Closed
opened 2026-02-21 19:05:31 -05:00 by yindo · 2 comments
Owner

Originally created by @AlexKuai on GitHub (Mar 24, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • 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.

Dify version

1.1.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I use an external Nginx as a reverse proxy to provide HTTPS services externally. pass through http://127.0.0.1:9080 Reverse proxy dify Docker nginx, but there is currently a problem with this method, which is that the internal access address still displays the HTTP protocol. How should I configure to display the correct HTTPS protocol address?

Image

✔️ Expected Behavior

Display HTTPS protocol address correctly

Actual Behavior

Only displaying the HTTP protocol address

Originally created by @AlexKuai on GitHub (Mar 24, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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. ### Dify version 1.1.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I use an external Nginx as a reverse proxy to provide HTTPS services externally. pass through http://127.0.0.1:9080 Reverse proxy dify Docker nginx, but there is currently a problem with this method, which is that the internal access address still displays the HTTP protocol. How should I configure to display the correct HTTPS protocol address? ![Image](https://github.com/user-attachments/assets/56864320-3f21-4302-9785-42e8667175a2) ### ✔️ Expected Behavior Display HTTPS protocol address correctly ### ❌ Actual Behavior Only displaying the HTTP protocol address
yindo added the 🐞 bug label 2026-02-21 19:05:31 -05:00
yindo closed this issue 2026-02-21 19:05:31 -05:00
Author
Owner

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

To address the issue of the internal access address displaying the HTTP protocol instead of HTTPS when using an external Nginx reverse proxy with Dify Docker Nginx, you can follow these configuration steps:

  1. Set the Host Header in Nginx Configuration:
    Modify the nginx/proxy.conf.template file to set the Host header to $http_host:

    proxy_set_header Host $http_host;
    
  2. Enable Respect for X-Forwarded Headers:
    In your docker-compose.yaml, ensure that the application respects X-Forwarded headers by adding the following environment variable:

    x-shared-env: &shared-api-worker-env
      RESPECT_XFORWARD_HEADERS_ENABLED: true
    
  3. Expose Correct Ports in the .env File:
    Make sure your .env file is configured to expose the correct ports for Nginx:

    EXPOSE_NGINX_PORT=80
    EXPOSE_NGINX_SSL_PORT=443
    

These changes should help ensure that the correct HTTPS protocol is displayed when accessing the Dify Docker Nginx through an external Nginx reverse proxy [1][2][3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 24, 2025): <!-- Answer --> To address the issue of the internal access address displaying the HTTP protocol instead of HTTPS when using an external Nginx reverse proxy with Dify Docker Nginx, you can follow these configuration steps: 1. **Set the Host Header in Nginx Configuration:** Modify the `nginx/proxy.conf.template` file to set the Host header to `$http_host`: ```nginx proxy_set_header Host $http_host; ``` 2. **Enable Respect for X-Forwarded Headers:** In your `docker-compose.yaml`, ensure that the application respects X-Forwarded headers by adding the following environment variable: ```yaml x-shared-env: &shared-api-worker-env RESPECT_XFORWARD_HEADERS_ENABLED: true ``` 3. **Expose Correct Ports in the .env File:** Make sure your `.env` file is configured to expose the correct ports for Nginx: ```env EXPOSE_NGINX_PORT=80 EXPOSE_NGINX_SSL_PORT=443 ``` These changes should help ensure that the correct HTTPS protocol is displayed when accessing the Dify Docker Nginx through an external Nginx reverse proxy <sup>[[1]](https://github.com/langgenius/dify/issues/13070)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/13480)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/jp/getting-started/install-self-hosted/faq.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/86b0246e-b5fb-45e0-81c7-941d0304047e?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/86b0246e-b5fb-45e0-81c7-941d0304047e?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/86b0246e-b5fb-45e0-81c7-941d0304047e?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/86b0246e-b5fb-45e0-81c7-941d0304047e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/86b0246e-b5fb-45e0-81c7-941d0304047e?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/86b0246e-b5fb-45e0-81c7-941d0304047e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/86b0246e-b5fb-45e0-81c7-941d0304047e?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Mar 24, 2025):

This is documented here https://docs.dify.ai/getting-started/install-self-hosted/environments

@crazywoola commented on GitHub (Mar 24, 2025): This is documented here https://docs.dify.ai/getting-started/install-self-hosted/environments
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12053