dify.crt can't be renamed #14136

Closed
opened 2026-02-21 19:15:44 -05:00 by yindo · 1 comment
Owner

Originally created by @Wystan0608 on GitHub (May 23, 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.4.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

i move my own ssl files into /root/dify/docker/nginx/ssl, and remove dify.crt and dify.key, then change relative informations in .env and docker compose.yaml。But nginx container cant be raise up.
Other places also reference the SSL certificate file dify.crt.

2025/05/23 07:10:16 [emerg] 10#10: cannot load certificate "/etc/ssl/dify.crt": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/ssl/dify.crt, r) error:10000080:BIO routines::no such file)
nginx: [emerg] cannot load certificate "/etc/ssl/dify.crt": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/ssl/dify.crt, r) error:10000080:BIO routines::no such file)

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Wystan0608 on GitHub (May 23, 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.4.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce i move my own ssl files into /root/dify/docker/nginx/ssl, and remove dify.crt and dify.key, then change relative informations in .env and docker compose.yaml。But nginx container cant be raise up. Other places also reference the SSL certificate file dify.crt. 2025/05/23 07:10:16 [emerg] 10#10: cannot load certificate "/etc/ssl/dify.crt": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/ssl/dify.crt, r) error:10000080:BIO routines::no such file) nginx: [emerg] cannot load certificate "/etc/ssl/dify.crt": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/ssl/dify.crt, r) error:10000080:BIO routines::no such file) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:15:44 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 23, 2025):

The nginx container is failing to start because it cannot find the SSL certificate at /etc/ssl/dify.crt. In Dify's Docker setup, the default SSL certificate filenames are dify.crt and dify.key, and these are referenced via environment variables in both the .env file and docker-compose.yaml (or docker-compose-template.yaml) for the nginx service. These files mount your local ./nginx/ssl directory to /etc/ssl inside the container, and expect the certificate filenames to match what is set in the environment variables (source).

To use your own SSL files with different names, make sure you:

  1. Place your certificate and key files in the ./nginx/ssl directory (relative to your Dify Docker setup).
  2. Update both the .env file and docker-compose.yaml so that:
    NGINX_SSL_CERT_FILENAME=your_cert_name.crt
    NGINX_SSL_CERT_KEY_FILENAME=your_key_name.key
    
  3. Ensure the filenames in the environment variables exactly match the files in ./nginx/ssl.
  4. Restart the nginx container after making these changes.

If nginx still tries to load /etc/ssl/dify.crt, it means there is still a reference to the old filename in your configuration. Double-check all relevant environment variables and configuration files for any lingering references to dify.crt or dify.key (source).

Also, verify that the new certificate files have the correct permissions and are accessible by the nginx container.

If you follow these steps and nginx still fails to start, please share the exact filenames and the relevant parts of your .env and docker-compose.yaml for further troubleshooting.

To continue talking to Dosu, mention @dosu-bot.


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

@dosubot[bot] commented on GitHub (May 23, 2025): <!-- Answer --> The nginx container is failing to start because it cannot find the SSL certificate at `/etc/ssl/dify.crt`. In Dify's Docker setup, the default SSL certificate filenames are `dify.crt` and `dify.key`, and these are referenced via environment variables in both the `.env` file and `docker-compose.yaml` (or `docker-compose-template.yaml`) for the nginx service. These files mount your local `./nginx/ssl` directory to `/etc/ssl` inside the container, and expect the certificate filenames to match what is set in the environment variables ([source](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)). To use your own SSL files with different names, make sure you: 1. Place your certificate and key files in the `./nginx/ssl` directory (relative to your Dify Docker setup). 2. Update both the `.env` file and `docker-compose.yaml` so that: ``` NGINX_SSL_CERT_FILENAME=your_cert_name.crt NGINX_SSL_CERT_KEY_FILENAME=your_key_name.key ``` 3. Ensure the filenames in the environment variables exactly match the files in `./nginx/ssl`. 4. Restart the nginx container after making these changes. If nginx still tries to load `/etc/ssl/dify.crt`, it means there is still a reference to the old filename in your configuration. Double-check all relevant environment variables and configuration files for any lingering references to `dify.crt` or `dify.key` ([source](https://github.com/langgenius/dify/blob/main/docker/.env.example)). Also, verify that the new certificate files have the correct permissions and are accessible by the nginx container. If you follow these steps and nginx still fails to start, please share the exact filenames and the relevant parts of your `.env` and `docker-compose.yaml` for further troubleshooting. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://go.dosu.dev/dosubot), mention @dosu-bot.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/a13a0ec2-27e8-4d3a-b5e4-1c0d160a1139?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/a13a0ec2-27e8-4d3a-b5e4-1c0d160a1139?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/a13a0ec2-27e8-4d3a-b5e4-1c0d160a1139?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/a13a0ec2-27e8-4d3a-b5e4-1c0d160a1139?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a13a0ec2-27e8-4d3a-b5e4-1c0d160a1139?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/a13a0ec2-27e8-4d3a-b5e4-1c0d160a1139?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a13a0ec2-27e8-4d3a-b5e4-1c0d160a1139?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14136