Clipboard Access and HTTPS
Fix clipboard access when the remote Web UI is served over HTTP
When accessing the Web UI locally at http://localhost:3000, copying image references and importing from the clipboard work out of the box. After deploying to a remote server and opening http://server-address:port, however, the browser may report that clipboard access is not supported.
This is a browser security restriction rather than a BioFlow AI configuration issue: the asynchronous Clipboard API is only available in a secure context. HTTPS and local localhost are treated as secure contexts, whereas remote plain HTTP origins are not.
Check the current page in the browser developer console:
({
origin: location.origin,
isSecureContext: window.isSecureContext,
clipboard: Boolean(navigator.clipboard),
readText: typeof navigator.clipboard?.readText === 'function',
})A remote HTTP page will normally report isSecureContext: false, with navigator.clipboard unavailable.
Option 1: Use Nginx and a trusted certificate (recommended)
Place an HTTPS reverse proxy in front of the Web UI. The browser connects to Nginx over HTTPS, while Nginx can continue to reach web-ui:3000 over HTTP inside the deployment network.
Browser ──HTTPS──> Nginx ──HTTP──> web-ui:3000Prepare the certificate
Prepare a certificate chain and private key, for example:
deploy/nginx/
├── bioflow.conf
└── tls/
├── fullchain.pem
└── privkey.pemThe certificate must meet these requirements:
- Its Subject Alternative Name (SAN) contains the hostname or IP address users actually open.
- The issuing CA is trusted by each user's operating system or browser.
- The private key is readable only by deployment administrators and the Nginx container, and is never committed to Git.
Use a public CA for a public hostname. An internal hostname or private IP normally requires an organisational CA; an untrusted self-signed certificate does not reliably enable the Clipboard API.
Configure Nginx
Create deploy/nginx/bioflow.conf:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/nginx/tls/fullchain.pem;
ssl_certificate_key /etc/nginx/tls/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
client_max_body_size 0;
location / {
proxy_pass http://web-ui:3000;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}Add the Compose service
Add an Nginx service to docker-compose.yml and connect it to the same web-ui-net network as web-ui:
services:
https-proxy:
image: nginx:stable-alpine
depends_on:
- web-ui
ports:
- "443:443"
volumes:
- ./deploy/nginx/bioflow.conf:/etc/nginx/conf.d/default.conf:ro
- ./deploy/nginx/tls:/etc/nginx/tls:ro
networks:
- web-ui-net
restart: unless-stoppedIf host port 443 is occupied, map a different port such as "3443:443", then open https://server-address:3443. Remove the original host ports mapping from web-ui, or restrict its HTTP port with a firewall, so users cannot bypass the HTTPS entry point.
docker compose config
docker compose up -d web-ui https-proxyAfter enabling HTTPS, set cookie_secure = true in config.toml and restart the API service. Running auto-init again may regenerate docker-compose.yml; back up and reapply the manually added HTTPS configuration.
Option 2: Treat a specific HTTP origin as secure in Chrome
This is a Chromium development and testing feature, not a production security solution. HTTP traffic remains unauthenticated and unencrypted, so an attacker on the same network may still modify the page scripts. Use it only temporarily on an explicitly trusted, isolated network, and never for a public origin.
Desktop Chrome or Chromium can remove the secure-context restriction for one HTTP origin:
- Open
chrome://flags/#unsafely-treat-insecure-origin-as-securein the address bar. - Under Insecure origins treated as secure, enter the complete origin, for example
http://your-ip:3001. The scheme and port must match the URL you actually open. - Set the option to Enabled, then select Relaunch to restart the browser completely.
- Open BioFlow AI again. Allow clipboard access if the browser asks for permission.
- In the console, confirm that
window.isSecureContextistrueandnavigator.clipboard?.readTextexists.
Update the origin whenever the page address or port changes. After troubleshooting, restore the experiment to Default and restart the browser again.
Some Chromium versions or organisation-managed browsers may hide or disable this setting. Firefox, Safari, and mobile browsers do not provide one consistent equivalent; use HTTPS if the setting is unavailable.
For background, see the Clipboard API security considerations and Chromium's guidance on insecure origins.