I deployed n8n by docker-compose, and add HTTPS_PROXY,HTTP_PROXY env, But I find that the HTTP Request NODE cannot access the internet HTTPS websit. It show the error “Parse Error: Expected HTTP/”
the docker env:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
- DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
- EXECUTIONS_MODE=queue
- QUEUE_BULL_REDIS_HOST=redis
- QUEUE_HEALTH_CHECK_ACTIVE=true
- N8N_SECURE_COOKIE=false
- N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}
- N8N_HOST=192.168.1.101
- N8N_DIAGNOSTICS_ENABLED=false
- N8N_VERSION_NOTIFICATIONS_ENABLED=false
- N8N_TEMPLATES_ENABLED=true
- NODE_FUNCTION_ALLOW_EXTERNAL=*
- NODE_FUNCTION_ALLOW_BUILTIN=*
- N8N_REINSTALL_MISSING_PACKAGES=true
- HTTPS_PROXY=http://proxyuser:proxypassword@proxyserver:9080/
- HTTP_PROXY=http://proxyuser:proxypasswordx@proxyserver:9080/
- NODE_TLS_REJECT_UNAUTHORIZED=0
- NODE_FUNCTION_ALLOW_EXTERNAL="*"
- NODE_FUNCTION_ALLOW_BUILTIN=true
- N8N_LOG_LEVEL=debug
the error message:

mysql workflow:
Share the output returned by the last node
Information on your n8n setup
- n8n version: 1.92.2
- Database :Postgres
- n8n EXECUTIONS_PROCESS setting (default: own, main):main
- Running n8n via (Docker, npm, n8n cloud, desktop app):Docker
- Operating system: centos7.9
The HTTP_PROXY and HTTPS_PROXY env variables are “generic” settings used by Node.js and/or Axios. They’re not specific to n8n, so they should function transparently if the proxy is set up right.
- Do you have an actual proxy running / listening at “proxyserver” on port 9080 (from
http://proxyuser:proxypasswordx@proxyserver:9080/
)? Assuming you have changed/masked the real proxy user/pw and hostname.
- If you use the same proxy details on something else running in the same docker environment, is the request forwarded through as expected?
If you want to test an alternative proxy server to isolate whether its something n8n is doing with the request, or something the proxy server isn’t passing through correctly, you could set up mitmproxy in another container to test.
That is starting to sound like a certificate/trusted-ca issue that isn’t getting reported back to you in n8n. Are you able to see any of the traffic/logs in the proxy itself?
Did you try with Ignore SSL Issues (Insecure)
option added and enabled?
- My network management colleague found no records in either the network device logs or the proxy server logs.
- I tried using the “Ignore SSL Issues (Insecure)” option, but it didn’t work.
- I tried using the “CODE Node” and used the following JS script, which allowed me to access
https://httpbin.org/ip
via the proxy.
const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");
async function call() {
const url = "https://httpbin.org/ip";
const agent = new HttpsProxyAgent("http://proxyuser:proxypasswordx@proxyserver:9080/");
const res = await axios.get(url, { httpsAgent:agent, proxy: false });
return res
}
result = await call();
console.log(result)
return {
body: result.data,
headers: result.headers,
statusCode: result.status,
statusMessage: result.statusText,
};
The resutl :
More things to try (if you haven’t already)…
- Add the Proxy option directly in the
HTTP Request
node to see if that works. This might help determine whether the Axios usage in the n8n code is handling the proxy part differently (i.e. I think this would indicate whether n8n’s Axios code is interfering with the underlying default behavior when HTTPS_PROXY
is specified in the environment).
- Try some of the same tests in a different version of n8n.
(I switched to n8n 1.92.2 but can’t get it to fail using mitmproxy. I have that proxy running as a peer container in the same Docker environment, so still not exactly apples to apples. Also didn’t catch what Proxy software you are using.)
FWIW,
I tried your Code
node in n8n 1.90.2 and it failed with a complaint about SSL: unable to verify the first certificate null
The same target URL https://httpbin.org/ip
works when the same proxy is specified as an option on the HTTP Request
node.
-
the HTTP Request Node option Proxy,I tried. The same problem, can access HTTP Internet website, HTTPS internet website failed.
-
I tried the different version: 1.84.2, 1.89.0, 1.89.2 ,1.92.2, all the same problem.
So , I guess,: the proxy server is missiong config or the n8n sever need more environment variables. Because the same request config is OK on the new N8N which server can directly access the internet website, not via proxy.