# exe.dev: a second nginx server for Dify, from https://exe.dev/deploy/dify # Save as ~/dify/docker/nginx/conf.d/exe-public.conf. Dify's own server # (host port 8080) keeps serving everything, including the console. This one # (host port 8000, the port https://.exe.xyz/ reaches) serves only what # published web apps, API clients, MCP clients, and webhooks need. server { listen 8000; server_name _; # Docker's DNS, so nginx starts even while a service is still booting. resolver 127.0.0.11 valid=30s ipv6=off; # Web apps read this one public console endpoint (branding, sign-in options). location = /console/api/system-features { set $api_upstream api:5001; proxy_pass http://$api_upstream; include proxy.conf; } # The console API, its live-collaboration socket, and personal-token API stay on 8080. location /console/ { return 404; } location /socket.io/ { return 404; } location /openapi { return 404; } # Web app API (/api), service API (/v1), signed files, MCP servers, # trigger webhooks, and human-input callbacks. location ~ ^/(api|v1|files|mcp|triggers|callbacks)(/|$) { set $api_upstream api:5001; proxy_pass http://$api_upstream; include proxy.conf; } # Plugin endpoints (webhooks that plugins register). location /e/ { set $plugin_daemon_upstream plugin_daemon:5002; proxy_pass http://$plugin_daemon_upstream; proxy_set_header Dify-Hook-Url $scheme://$host$request_uri; include proxy.conf; } # The web app pages themselves (/chat/..., /workflow/..., /completion/...). location / { set $web_upstream web:3000; proxy_pass http://$web_upstream; include proxy.conf; } }