Yeah it was, so I’ve solved yesterday night. It because from the directory. It calls the UI’s assets from the wrong path. I thought I edited the .env file, but systemd overrides (/etc/systemd/system/n8n.service.d/override.conf) it.
N8N_PATH=/n8n/
WEBHOOK_URL=https://<domain>.tld/n8n/
N8N_EDITOR_BASE_URL=...
YunoHost’s SSO enters between of them returns HTML instead JS/CSS, and the browser reports “MIME nosniff” breaks the UI.
Also, the paths are looks weird like:
/n8nstatic/, /n8nassets/, /n8nfavicon.ico
So the solution that I made is:
- Editing the override file into correct URL/path and then restart.
While solving this issue I applied those prompts:
1) Checking the n8n if it is active:
sudo systemctl status n8n --no-pager -l
2) Is UI shown on local?
curl -sS http://127.0.0.1:48248 | head -n 20
3) Checking the paths of assets (the most crucial one):
curl -sS http://127.0.0.1:48248 | grep -oE 'n8nassets|n8nstatic|n8nfavicon' | head
4) Is systemd really overrides it?
sudo systemctl cat n8n | sed -n '1,160p'
Also checked /etc/systemd/system/n8n.service.d/override.conf if there is N8N_PATH, WEBHOOK_URL, N8N_EDITOR_BASE_URL.
5) Writing the correct settings to override file
Configuration for subdomain:
[Service]
Environment="WEBHOOK_URL=https://n8n.<your-domain>.xyz/"
Environment="N8N_EDITOR_BASE_URL=https://n8n.<your-domain>.xyz/"
Environment="N8N_PATH=/"
Or in path like /n8n/:
[Service]
Environment="WEBHOOK_URL=https://<your-domain>.xyz/n8n/"
Environment="N8N_EDITOR_BASE_URL=https://<your-domain>.xyz/n8n/"
Environment="N8N_PATH=/n8n/"
6) Reload + restart
sudo systemctl daemon-reload
sudo systemctl restart n8n
7) Checking again local HTML to see if our settings that I made are applied:
curl -sS http://127.0.0.1:48248 | grep -oE 'n8nassets|n8nstatic|n8nfavicon' | head
Notice: It mustn’t see the paths like: /n8nstatic/, /n8nassets/, /n8nfavicon.ico etc.
8) Looking for is there nginx/SSO redirect from outside:
curl -k -I https://<your-domain>.xyz/n8n/ | head -n 20
If location indicates as /yunohost/sso/ (something like that) it redirects to SSO.