Self-hosted n8n has two settings for outbound proxies. The HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY environment variables apply to HTTP traffic from nodes that use n8n’s built-in HTTP clients, which covers most of them. The HTTP Request node also has its own Proxy option, which overrides those variables for that node. N8N_PROXY_HOPS, the variable most people find first, isn’t an outbound setting at all: it tells n8n how many reverse proxies sit in front of it.
This guide covers both outbound settings on a VPS where n8n already runs in Docker Compose, how to confirm which IP your workflows actually use, which nodes behave differently, and the errors you’re likely to hit.
Inbound or outbound: which proxy are you configuring?
Most n8n guides about proxies are about the reverse proxy in front of the editor and webhooks: Nginx, Traefik or Caddy terminating TLS and forwarding requests to port 5678. That’s inbound traffic. An outbound proxy sits on the other side, between your workflows and the APIs or websites they call.
| Setting | Direction | What it does |
|---|---|---|
N8N_PROXY_HOPS | Inbound | Tells n8n to trust X-Forwarded-* headers from that many reverse proxies, so it sees the real client IP and protocol |
N8N_WEBHOOK_URL | Inbound | Sets the public base URL n8n shows and registers for webhooks behind a reverse proxy |
HTTP_PROXY, HTTPS_PROXY, ALL_PROXY | Outbound | Send HTTP and HTTPS requests from nodes through a proxy |
NO_PROXY | Outbound | Lists hosts that n8n should reach directly, bypassing the proxy |
| HTTP Request node, Add Option → Proxy | Outbound, per node | Sends one node’s requests through a specific proxy and overrides the environment variables |
If your webhooks show the wrong URL or your logs show the reverse proxy’s address instead of the visitor’s, you need the inbound settings. If an external site or API rejects your requests because of where they come from, keep reading.
Why route n8n’s outbound traffic through a proxy
The most common reason is a target that rejects hosting networks. Many websites and some APIs rate-limit or block whole hosting ranges, so a workflow that checks prices, monitors pages or pulls public data from a VPS can start failing even at low volume. A proxy helps only with requests you’re allowed to make in the first place; it doesn’t change a site’s terms.
Location is the second reason: a workflow that has to see the prices, search results or content shown in another country needs an exit IP in that country.
The third is a partner API that only accepts requests from allowlisted IPs. Your VPS address changes when you replace the server or move to another provider (resizing or reinstalling the same server usually keeps it), and each change means asking the partner to update their allowlist. A static proxy IP that only you use stays the same across those moves: the partner keeps allowlisting the proxy’s IP, and you only update which server IP the proxy accepts. If your VPS address is stable and the partner already allows it, you don’t need a proxy for this.
Step 1: get a static ISP proxy that authenticates by your VPS’s IP
If the sites your workflows call rate-limit hosting ranges, another datacenter IP often won’t help, because many filters judge the type of network, not just the single address. Static ISP proxies are registered to internet service providers rather than hosting companies, so filters that look up the network owner see an ISP address, and the IP stays the same for the whole term. That isn’t a guarantee: some services also keep lists of known proxy ranges, so test against the site or API you actually need.
Also pick a proxy that authorizes your server by its IP address rather than by a password in the URL. FineProxy’s ISP proxies work this way: access is always tied to an IP allowlist, so you add your VPS’s public IP in the dashboard and the proxy accepts connections from it without credentials. That keeps secrets out of workflow JSON, which often ends up in Git, and out of the container’s environment, which shows up in docker inspect and support screenshots. The trade-off is that the allowlist trusts every process on that server, so if other people or untrusted containers share the VPS, add the optional login and password on top.
FineProxy sells ISP proxies in two forms. Dedicated ISP IPs are used only by you and start from a single address at $3.20 per month, in Germany, Italy, Spain and the Seychelles; that’s the option for a partner integration where the partner allowlists your exit IP. Shared ISP packages start at 100 IPs for $30 a month ($0.30 per IP), with up to five customers per address, in Europe Mix and Spain, and suit setups that spread workflows or clients across many exits.
Find your VPS’s public IPv4 address from the server itself. The proxies are IPv4, so the allowlist needs the IPv4 address:
curl -4 -s https://api.ipify.org
It prints a single address, such as 198.51.100.24. Add it to the allowlist, then copy the proxy’s IP and its HTTP port for allowlist access from the dashboard. On FineProxy, that’s port 8085; port 8080 is the HTTP port for login-and-password access. Use an HTTP port rather than a SOCKS one for n8n. Before touching n8n, check that the proxy accepts your server:
curl -s -x http://203.0.113.10:8085 https://api.ipify.org
If it prints the proxy’s IP rather than your VPS’s, the allowlist works.
Step 2: set the proxy environment variables in Docker Compose
Add the variables to the environment section of your existing n8n service and leave the rest of the file as it is. The example uses a documentation IP; replace it with your proxy’s address and the hostnames with your own.
services:
n8n:
image: docker.n8n.io/n8nio/n8n
# your existing ports, volumes and other variables stay as they are
environment:
- HTTP_PROXY=http://203.0.113.10:8085
- HTTPS_PROXY=http://203.0.113.10:8085
- NO_PROXY=localhost,127.0.0.1,n8n,n8n.example.com,ollama,.internal.example.com
HTTPS_PROXY still points to an http:// URL. That’s normal: the client opens a tunnel to the proxy with a CONNECT request, and the TLS session to the target runs inside it. Setting only HTTP_PROXY is a common mistake, because almost every API today is HTTPS and those requests would keep going out directly.
NO_PROXY matters as much as the proxy itself. n8n compares it with the hostname exactly as it appears in the request URL: localhost doesn’t cover 127.0.0.1, a bare name doesn’t cover its subdomains, and a leading dot, as in .internal.example.com, covers every host under that domain. IP ranges such as 10.0.0.0/8 aren’t supported. List everything n8n calls over HTTP inside your own setup: localhost and 127.0.0.1, Docker service names such as n8n and ollama, and your public n8n hostname if workflows call their own webhook URLs. Otherwise those requests leave the server, go through the proxy and come back, or fail. Database and Redis connections aren’t HTTP, so the proxy variables don’t touch them.
Apply the change with docker compose up -d from the directory with your compose file, not docker compose restart. A restart reuses the existing container with its old environment, while up -d recreates it with the new variables. If you run n8n in queue mode, add the same variables to every worker service, because workers run the production executions.
Two more details. n8n reads these variables through the proxy-from-env package, where lowercase names such as http_proxy win over uppercase ones if both are in the container’s environment, so an old lowercase variable loaded from an env_file can silently override the new value. And ALL_PROXY is only a fallback, used when the more specific HTTP_PROXY or HTTPS_PROXY isn’t set.
While you’re editing the file, check how port 5678 is published. A plain "5678:5678" opens n8n on every interface, and Docker’s port publishing bypasses host firewalls such as UFW. Behind a reverse proxy on the same server, "127.0.0.1:5678:5678" is enough.
Step 3: use the HTTP Request node’s proxy for individual workflows
When only some workflows should use a proxy, or different workflows need different exit IPs, set the proxy in the node. Open the HTTP Request node, choose Add Option → Proxy, and enter the proxy URL, for example http://203.0.113.10:8085. For login-and-password access, the format is http://<login>:<password>@<proxy-ip>:8080, but the password is then saved in the workflow JSON.
n8n’s documentation says this option takes precedence over HTTP_PROXY, HTTPS_PROXY and ALL_PROXY for that node; every other node keeps following the environment variables. That allows two setups. Without global variables, the server sends traffic directly and only the nodes you configure use a proxy, such as a price-monitoring workflow with an IP in Spain. With global variables, everything uses the default proxy and individual nodes switch to a different one. Only the HTTP Request node has this option: app nodes such as Slack or Google Sheets follow the environment variables or connect directly. Because the option is per node, it’s easy to miss in a large workflow, so put the proxy in the node’s name.
Step 4: check which IP n8n actually uses
Don’t assume the proxy works because nothing broke. Add an HTTP Request node with the method GET and the URL https://api.ipify.org?format=json, then run it. A working proxy returns its own address, for example {"ip":"203.0.113.10"}.
If the response shows your VPS’s IP, the environment variables didn’t reach the container or the node is bypassing them. Run docker compose exec n8n env | grep -i proxy to see which proxy variables the running container actually has; the output reveals leftover lowercase variables and typos at a glance. It also prints a proxy password if you put one in a variable, so don’t paste it into support tickets as is.
This check proves the path for HTTP Request nodes. Repeat it after every n8n upgrade and server migration. When the VPS gets a new public IP, the proxy rejects its connections until you update the allowlist, so check the server’s address after any move, before production workflows run.
AI nodes and the Code node
In current n8n releases (we checked 2.48.7), the main AI chat model nodes follow the proxy variables too. Google Gemini Chat Model, Ollama Chat Model and Microsoft Foundry Chat Model (formerly Azure OpenAI Chat Model) send their requests through n8n’s proxy-aware HTTP client and respect NO_PROXY for their endpoints. Some n8n documentation pages still describe older behavior, where Gemini and Ollama ignored the proxy and the Azure node ignored NO_PROXY; on older versions those limitations may still apply.
That reverses the advice in older guides: a local Ollama server now goes through the external proxy unless its hostname is in NO_PROXY. Use the exact host from the Ollama credential’s Base URL, such as ollama for a Compose service or host.docker.internal for Ollama running on the host itself.
The Code node is the exception to know about. Requests made with fetch() inside a Code node don’t go through the proxy, so they leave from the VPS’s address. If a request has to use the proxy, make it in an HTTP Request node. For community nodes, run the same IP check before relying on them in production.
N8N_PROXY_HOPS: the setting people confuse with an outbound proxy
N8N_PROXY_HOPS comes up first when you search for n8n proxy settings, but it has nothing to do with outbound traffic. It tells n8n whether to trust the X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto headers set by reverse proxies in front of it, so that n8n sees the real visitor’s IP and knows the original request used HTTPS.
Behind a single Nginx or Traefik instance, n8n’s documentation recommends N8N_PROXY_HOPS=1 together with N8N_WEBHOOK_URL set to your public URL, such as https://n8n.example.com/. On versions before 2.30.0, use WEBHOOK_URL instead. Set the hop count only when n8n is reachable solely through that reverse proxy: if port 5678 is also open to the internet, anyone can send forged X-Forwarded-For headers straight to n8n. Setting N8N_PROXY_HOPS never changes the IP your workflows use to call external APIs.
Troubleshooting n8n proxy errors
| Symptom | Likely cause | Fix |
|---|---|---|
| The IP check still shows the VPS address | Container not recreated, or a lowercase variable overrides the new one | Run docker compose up -d; check env output inside the container |
| HTTP APIs go through the proxy, HTTPS APIs don’t | Only HTTP_PROXY is set | Add HTTPS_PROXY with the same proxy URL |
407 Proxy Authentication Required | The URL points to the login port 8080 without credentials | Use the allowlist port 8085, or add the login and password to the proxy URL as in Step 3 |
ECONNREFUSED or timeouts when connecting to the proxy | Wrong IP or port, or the VPS’s current IP isn’t on the allowlist, often after a server move | Check the address and port in the dashboard; run the curl -x test from Step 1 |
EPROTO or TLS errors on every proxied request | The proxy URL starts with https:// | Use http:// for the proxy URL, even for HTTPS targets |
| Calls to your own webhooks or internal services are slow or fail | Their hostname isn’t in NO_PROXY exactly as it appears in the URL | Add the exact hostname, or a leading-dot domain, to NO_PROXY |
| The Ollama node fails after you add a proxy | The Ollama host isn’t in NO_PROXY, so requests go to the external proxy | Add the host from the Ollama credential’s Base URL |
| One workflow uses a different IP than the rest | The HTTP Request node has its own Proxy option set | Check the node’s options; it overrides the environment variables |
fetch() calls from a Code node show the VPS address | fetch() in the Code node doesn’t use the proxy variables | Move the request into an HTTP Request node |
What a proxy adds to your setup
A proxy is one more dependency, so know what you take on:
- The provider sees which hosts your workflows connect to, plus timing and volume. For HTTPS targets it doesn’t see request contents, headers or API keys, because TLS runs end to end inside the tunnel; plain
http://requests are visible in full. - Don’t install a provider’s certificate or disable TLS verification, for example with
NODE_TLS_REJECT_UNAUTHORIZED=0, to make a proxy work. A forward proxy for n8n needs neither. - Every proxied request takes an extra hop, which adds latency, especially when the proxy and the API are on different continents.
- If the proxy is down or the allowlist is out of date, proxied nodes fail; n8n doesn’t fall back to a direct connection.
Checklist before you rely on a proxy in production
- Decide whether the proxy should apply to all nodes or only to specific HTTP Request nodes.
- Allowlist your VPS’s IPv4 address with the proxy provider, use the allowlist port, and test it with
curl -xbefore changing n8n. - Set both
HTTP_PROXYandHTTPS_PROXY, and list every internal hostname inNO_PROXYexactly as it appears in URLs. - Recreate the container, and the workers in queue mode, then confirm the exit IP with an HTTP Request node.
- Test each AI node you use, and keep local model servers out of the proxy with
NO_PROXY. - Recheck the exit IP after upgrades and server migrations.










