Hi everyone,
I’m running into a strange issue with the REST API on my self-hosted n8n setup. I’ve tried everything I could think of and I’m honestly out of ideas at this point
Setup
Ubuntu Server 24.04 (also tested on 22.04)
Installed via Proxmox VM
Docker + Portainer
n8n container created via Portainer stack
Image tested:
n8nio/n8n:1.120.4
n8nio/n8n:stable
n8nio/n8n:latest
Frontend works fine: http://192.168.178.88:5678
Basic Auth enabled (admin / admin123 just for testing)
I’m new to Docker, servers etc. and used ChatGPT + tutorials for guidance
The actual problem
When I call the REST endpoint, I always get the full HTML of the n8n frontend.
Example:
curl -u admin:admin123 http://192.168.178.88:5678/rest/settings
→ returns the entire HTML page of the editor instead of JSON.
If I force JSON:
curl -u admin:admin123 -H “Accept: application/json” http://192.168.178.88:5678/rest/settings
→ returns:
Cannot GET /rest/settings
Environment variables inside the container look correct:
N8N_ENDPOINT_REST=/rest
N8N_ENDPOINT_WEBHOOK=/webhook
N8N_EXTERNAL_FRONTEND_BASE_URL=http://192.168.178.88:5678
N8N_BASIC_AUTH_ACTIVE=true
N8N_HOST=192.168.178.88
Everything else looks normal
What I already tried
Different n8n versions (stable, latest, pinned 1.120.4)
Multiple stacks in Portainer
Deleted old volumes and containers
Reinstalled Docker and Portainer
Reinstalled Ubuntu once
Clean Proxmox VM
Tried with and without REST endpoint variables
Tried simple and minimal docker-compose
Tried full, extended docker-compose
Verified environment variables inside the container
Checked file permissions
Even tested on my Windows laptop with Docker Desktop → there it works immediately
Exact same docker-compose → result is different on Ubuntu
So something on Ubuntu/Proxmox/Portainer/Docker seems to override or block the REST endpoints.
Additional info
I don’t have deep server knowledge, so everything was done with guidance from ChatGPT and documentation.
But I really tried every possible option I could find.
If needed, I can also upload screenshots from Portainer (container details, ENV vars, Port configuration).
Question
Why does the REST API always return the frontend instead of JSON?
Is this a known change in newer versions?
Or is Portainer/Proxmox somehow interfering with routing?
Any help is appreciated. I’ve spent many hours on this already.
Thanks in advance!
hello @Furkan_Kilic
Why are you trying to connect to the n8n APi via the /rest/settings path? n8n doesn’t have this path exposed as an API endpoint
Hi, thanks for your reply and the clarification!
I wasn’t aware that /rest/settings isn’t a public API endpoint.
I found some older examples online and assumed it was a valid way to test whether the REST API is accessible — which obviously wasn’t the case.
In my situation, the problem ended up being a combination of two things:
1. I was using an unsupported path (/rest/settings)
2. My setup didn’t have a proper reverse proxy in front of n8n
On Docker Desktop it worked by accident, but on Ubuntu/Proxmox it didn’t.
After setting up a proper reverse proxy (Caddy) and accessing the official endpoints, the REST API finally worked as expected.
Thanks again for pointing me in the right direction really appreciate the help!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
