dify 配置域名https访问
摘要:该配置展示了Dify平台的Docker环境设置,包括API、Web控制台和文件服务的URL地址(均指向https://123.xyz),以及跨域访问和Nginx服务器配置。Nginx配置文件中定义了不同路径的代理转发规则,监听80和443端口,并启用了SSL证书(dify.crt和dify.key)支持HTTPS协议。配置还包含TLS协议版本和会话缓存设置,确保安全连接。
·
cat /root/dify/docker/.env
# 控制台 API 地址
CONSOLE_API_URL=https://123.xyz
# 控制台 Web 界面地址
CONSOLE_WEB_URL=https://123.xyz
# 服务 API 地址
SERVICE_API_URL=https://123.xyz
# 应用 API 地址
APP_API_URL=https://123.xyz
# 应用 Web 界面地址
APP_WEB_URL=https://123.xyz
# 文件服务地址
FILES_URL=https://123.xyz
# ===== CORS 跨域配置 =====
# Web API 允许的跨域来源(支持 HTTPS 和 HTTP)
WEB_API_CORS_ALLOW_ORIGINS=https://123.xyz,http://123.xyz
# 控制台允许的跨域来源(支持 HTTPS 和 HTTP)
CONSOLE_CORS_ALLOW_ORIGINS=https://123.xyz,http://123.xyz
# ===== Nginx 配置 =====
# Nginx 服务器名称
NGINX_SERVER_NAME=123.xyz
拷贝证书
/root/dify/docker/nginx/ssl
dify.crt
dify.key
docker exec docker-nginx-1 cat /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name 123.xyz;
location /console/api {
proxy_pass http://api:5001;
include proxy.conf;
}
location /api {
proxy_pass http://api:5001;
include proxy.conf;
}
location /v1 {
proxy_pass http://api:5001;
include proxy.conf;
}
location /files {
proxy_pass http://api:5001;
include proxy.conf;
}
location /explore {
proxy_pass http://web:3000;
include proxy.conf;
}
location /e/ {
proxy_pass http://plugin_daemon:5002;
proxy_set_header Dify-Hook-Url $scheme://$host$request_uri;
include proxy.conf;
}
location / {
proxy_pass http://web:3000;
include proxy.conf;
}
location /mcp {
proxy_pass http://api:5001;
include proxy.conf;
}
# placeholder for acme challenge location
# placeholder for https config defined in https.conf.template
# Please do not directly edit this file. Instead, modify the .env variables related to NGINX configuration.
listen 443 ssl;
ssl_certificate /etc/ssl/dify.crt;
ssl_certificate_key /etc/ssl/dify.key;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
}
火山引擎开发者社区是火山引擎打造的AI技术生态平台,聚焦Agent与大模型开发,提供豆包系列模型(图像/视频/视觉)、智能分析与会话工具,并配套评测集、动手实验室及行业案例库。社区通过技术沙龙、挑战赛等活动促进开发者成长,新用户可领50万Tokens权益,助力构建智能应用。
更多推荐


所有评论(0)