Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: API access Base URLs are incorrect, resulting in inaccessible endpoints #4534

Closed
4 tasks done
tregu148 opened this issue May 20, 2024 · 3 comments
Closed
4 tasks done
Labels
🐞 bug Something isn't working

Comments

@tregu148
Copy link

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).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.8

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Install Dify v0.6.8 via self-hosting, elestio
Check the API access Base URLs in the configuration
Observe that all the Base URLs use HTTP protocol instead of HTTPS
スクリーンショット 2024-05-20 190746

✔️ Expected Behavior

The API access Base URLs should be correct and allow for successful access to the API endpoints.

❌ Actual Behavior

The Base URL strings for API access are incorrect, resulting in the inability to access the API endpoints. When attempting to use the provided Base URLs, the endpoints cannot be reached.

Copy link

dosubot bot commented May 20, 2024

To address the issue with the API access Base URLs using HTTP instead of HTTPS in your self-hosted Dify setup, you'll need to ensure your setup is configured for HTTPS. This involves obtaining an SSL certificate, configuring your reverse proxy (like nginx) to handle HTTPS, and adjusting the Base URLs in your configuration to use https://. Here's a concise guide:

  1. Obtain an SSL Certificate: Use a provider like Let's Encrypt to get a free SSL certificate.

  2. Configure Nginx for HTTPS: Update your nginx configuration to include SSL settings, pointing it to your SSL certificate and key files. Here's a basic example:

    server {
        listen 443 ssl;
        server_name your_domain.com;
    
        ssl_certificate /path/to/your/fullchain.pem;
        ssl_certificate_key /path/to/your/privkey.pem;
    
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers HIGH:!aNULL:!MD5;
    }
  3. Adjust Base URLs: Make sure all base URLs in your Dify configuration use https://.

  4. Update Docker Configuration: Ensure your docker-compose.yaml reflects the changes, especially regarding nginx service configuration to include your SSL certificates:

    nginx:
      image: nginx:latest
      volumes:
        - ./path/to/your/ssl:/etc/ssl:ro  # Mount your SSL directory
      ports:
        - "443:443"  # Expose port 443 for HTTPS

After applying these changes and restarting your Docker containers, your API endpoints should be accessible over HTTPS, resolving the issue with incorrect Base URLs.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added the 🐞 bug Something isn't working label May 20, 2024
@patryk20120
Copy link
Contributor

You may want to change API URL to https

@tregu148
Copy link
Author

Yes. By changing API URL to https, I could acccess apis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants