{"id":2992,"date":"2026-11-25T18:03:32","date_gmt":"2026-11-25T17:03:32","guid":{"rendered":"https:\/\/extendsclass.com\/blog\/?p=2992"},"modified":"2026-11-25T17:58:15","modified_gmt":"2026-11-25T16:58:15","slug":"n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps","status":"publish","type":"post","link":"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps","title":{"rendered":"n8n proxy settings: How to route outbound requests through a proxy on a self-hosted VPS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Self-hosted n8n has two settings for outbound proxies. The <code>HTTP_PROXY<\/code>, <code>HTTPS_PROXY<\/code>, <code>ALL_PROXY<\/code> and <code>NO_PROXY<\/code> environment variables apply to HTTP traffic from nodes that use n8n&#8217;s built-in HTTP clients, which covers most of them. The HTTP Request node also has its own <strong>Proxy<\/strong> option, which overrides those variables for that node. <code>N8N_PROXY_HOPS<\/code>, the variable most people find first, isn&#8217;t an outbound setting at all: it tells n8n how many reverse proxies sit in front of it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;re likely to hit.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_47_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"ez-toc-toggle-icon-1\"><label for=\"item-6b071bdad3f59\" aria-label=\"Table of Content\"><span style=\"display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;direction:ltr;\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/label><input  type=\"checkbox\" id=\"item-6b071bdad3f59\"><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#Inbound_or_outbound_which_proxy_are_you_configuring\" title=\"Inbound or outbound: which proxy are you configuring?\">Inbound or outbound: which proxy are you configuring?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#Why_route_n8n%E2%80%99s_outbound_traffic_through_a_proxy\" title=\"Why route n8n&#8217;s outbound traffic through a proxy\">Why route n8n&#8217;s outbound traffic through a proxy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#Step_1_get_a_static_ISP_proxy_that_authenticates_by_your_VPS%E2%80%99s_IP\" title=\"Step 1: get a static ISP proxy that authenticates by your VPS&#8217;s IP\">Step 1: get a static ISP proxy that authenticates by your VPS&#8217;s IP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#Step_2_set_the_proxy_environment_variables_in_Docker_Compose\" title=\"Step 2: set the proxy environment variables in Docker Compose\">Step 2: set the proxy environment variables in Docker Compose<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#Step_3_use_the_HTTP_Request_node%E2%80%99s_proxy_for_individual_workflows\" title=\"Step 3: use the HTTP Request node&#8217;s proxy for individual workflows\">Step 3: use the HTTP Request node&#8217;s proxy for individual workflows<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#Step_4_check_which_IP_n8n_actually_uses\" title=\"Step 4: check which IP n8n actually uses\">Step 4: check which IP n8n actually uses<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#AI_nodes_and_the_Code_node\" title=\"AI nodes and the Code node\">AI nodes and the Code node<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#N8N_PROXY_HOPS_the_setting_people_confuse_with_an_outbound_proxy\" title=\"N8N_PROXY_HOPS: the setting people confuse with an outbound proxy\">N8N_PROXY_HOPS: the setting people confuse with an outbound proxy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#Troubleshooting_n8n_proxy_errors\" title=\"Troubleshooting n8n proxy errors\">Troubleshooting n8n proxy errors<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#What_a_proxy_adds_to_your_setup\" title=\"What a proxy adds to your setup\">What a proxy adds to your setup<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/extendsclass.com\/blog\/n8n-proxy-settings-how-to-route-outbound-requests-through-a-proxy-on-a-self-hosted-vps\/#Checklist_before_you_rely_on_a_proxy_in_production\" title=\"Checklist before you rely on a proxy in production\">Checklist before you rely on a proxy in production<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Inbound_or_outbound_which_proxy_are_you_configuring\"><\/span>Inbound or outbound: which proxy are you configuring?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;s inbound traffic. An outbound proxy sits on the other side, between your workflows and the APIs or websites they call.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Setting<\/th><th>Direction<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td><code>N8N_PROXY_HOPS<\/code><\/td><td>Inbound<\/td><td>Tells n8n to trust <code>X-Forwarded-*<\/code> headers from that many reverse proxies, so it sees the real client IP and protocol<\/td><\/tr><tr><td><code>N8N_WEBHOOK_URL<\/code><\/td><td>Inbound<\/td><td>Sets the public base URL n8n shows and registers for webhooks behind a reverse proxy<\/td><\/tr><tr><td><code>HTTP_PROXY<\/code>, <code>HTTPS_PROXY<\/code>, <code>ALL_PROXY<\/code><\/td><td>Outbound<\/td><td>Send HTTP and HTTPS requests from nodes through a proxy<\/td><\/tr><tr><td><code>NO_PROXY<\/code><\/td><td>Outbound<\/td><td>Lists hosts that n8n should reach directly, bypassing the proxy<\/td><\/tr><tr><td>HTTP Request node, Add Option \u2192 Proxy<\/td><td>Outbound, per node<\/td><td>Sends one node&#8217;s requests through a specific proxy and overrides the environment variables<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If your webhooks show the wrong URL or your logs show the reverse proxy&#8217;s address instead of the visitor&#8217;s, you need the inbound settings. If an external site or API rejects your requests because of where they come from, keep reading.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_route_n8n%E2%80%99s_outbound_traffic_through_a_proxy\"><\/span>Why route n8n&#8217;s outbound traffic through a proxy<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;re allowed to make in the first place; it doesn&#8217;t change a site&#8217;s terms.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;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&#8217;t need a proxy for this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_get_a_static_ISP_proxy_that_authenticates_by_your_VPS%E2%80%99s_IP\"><\/span>Step 1: get a static ISP proxy that authenticates by your VPS&#8217;s IP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the sites your workflows call rate-limit hosting ranges, another datacenter IP often won&#8217;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&#8217;t a guarantee: some services also keep lists of known proxy ranges, so test against the site or API you actually need.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also pick a proxy that authorizes your server by its IP address rather than by a password in the URL. FineProxy&#8217;s <a href=\"https:\/\/fineproxy.org\/proxy\/static-residential-proxies\/?utm_source=hostadvice_com&amp;utm_medium=placement&amp;utm_campaign=guide\">ISP proxies<\/a> work this way: access is always tied to an IP allowlist, so you add your VPS&#8217;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&#8217;s environment, which shows up in <code>docker inspect<\/code> 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Find your VPS&#8217;s public IPv4 address from the server itself. The proxies are IPv4, so the allowlist needs the IPv4 address:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -4 -s https:\/\/api.ipify.org\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It prints a single address, such as <code>198.51.100.24<\/code>. Add it to the allowlist, then copy the proxy&#8217;s IP and its HTTP port for allowlist access from the dashboard. On FineProxy, that&#8217;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:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -s -x http:\/\/203.0.113.10:8085 https:\/\/api.ipify.org\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If it prints the proxy&#8217;s IP rather than your VPS&#8217;s, the allowlist works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_set_the_proxy_environment_variables_in_Docker_Compose\"><\/span>Step 2: set the proxy environment variables in Docker Compose<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add the variables to the <code>environment<\/code> 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&#8217;s address and the hostnames with your own.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services:\n  n8n:\n    image: docker.n8n.io\/n8nio\/n8n\n    # your existing ports, volumes and other variables stay as they are\n    environment:\n      - HTTP_PROXY=http:\/\/203.0.113.10:8085\n      - HTTPS_PROXY=http:\/\/203.0.113.10:8085\n      - NO_PROXY=localhost,127.0.0.1,n8n,n8n.example.com,ollama,.internal.example.com\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>HTTPS_PROXY<\/code> still points to an <code>http:\/\/<\/code> URL. That&#8217;s normal: the client opens a tunnel to the proxy with a <code>CONNECT<\/code> request, and the TLS session to the target runs inside it. Setting only <code>HTTP_PROXY<\/code> is a common mistake, because almost every API today is HTTPS and those requests would keep going out directly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>NO_PROXY<\/code> matters as much as the proxy itself. n8n compares it with the hostname exactly as it appears in the request URL: <code>localhost<\/code> doesn&#8217;t cover <code>127.0.0.1<\/code>, a bare name doesn&#8217;t cover its subdomains, and a leading dot, as in <code>.internal.example.com<\/code>, covers every host under that domain. IP ranges such as <code>10.0.0.0\/8<\/code> aren&#8217;t supported. List everything n8n calls over HTTP inside your own setup: <code>localhost<\/code> and <code>127.0.0.1<\/code>, Docker service names such as <code>n8n<\/code> and <code>ollama<\/code>, 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&#8217;t HTTP, so the proxy variables don&#8217;t touch them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Apply the change with <code>docker compose up -d<\/code> from the directory with your compose file, not <code>docker compose restart<\/code>. A restart reuses the existing container with its old environment, while <code>up -d<\/code> 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two more details. n8n reads these variables through the <code>proxy-from-env<\/code> package, where lowercase names such as <code>http_proxy<\/code> win over uppercase ones if both are in the container&#8217;s environment, so an old lowercase variable loaded from an <code>env_file<\/code> can silently override the new value. And <code>ALL_PROXY<\/code> is only a fallback, used when the more specific <code>HTTP_PROXY<\/code> or <code>HTTPS_PROXY<\/code> isn&#8217;t set.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While you&#8217;re editing the file, check how port 5678 is published. A plain <code>\"5678:5678\"<\/code> opens n8n on every interface, and Docker&#8217;s port publishing bypasses host firewalls such as UFW. Behind a reverse proxy on the same server, <code>\"127.0.0.1:5678:5678\"<\/code> is enough.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_use_the_HTTP_Request_node%E2%80%99s_proxy_for_individual_workflows\"><\/span>Step 3: use the HTTP Request node&#8217;s proxy for individual workflows<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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 <strong>Add Option \u2192 Proxy<\/strong>, and enter the proxy URL, for example <code>http:\/\/203.0.113.10:8085<\/code>. For login-and-password access, the format is <code>http:\/\/&lt;login&gt;:&lt;password&gt;@&lt;proxy-ip&gt;:8080<\/code>, but the password is then saved in the workflow JSON.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">n8n&#8217;s documentation says this option takes precedence over <code>HTTP_PROXY<\/code>, <code>HTTPS_PROXY<\/code> and <code>ALL_PROXY<\/code> 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&#8217;s easy to miss in a large workflow, so put the proxy in the node&#8217;s name.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_check_which_IP_n8n_actually_uses\"><\/span>Step 4: check which IP n8n actually uses<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t assume the proxy works because nothing broke. Add an HTTP Request node with the method <code>GET<\/code> and the URL <code>https:\/\/api.ipify.org?format=json<\/code>, then run it. A working proxy returns its own address, for example <code>{\"ip\":\"203.0.113.10\"}<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the response shows your VPS&#8217;s IP, the environment variables didn&#8217;t reach the container or the node is bypassing them. Run <code>docker compose exec n8n env | grep -i proxy<\/code> 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&#8217;t paste it into support tickets as is.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;s address after any move, before production workflows run.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"AI_nodes_and_the_Code_node\"><\/span>AI nodes and the Code node<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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&#8217;s proxy-aware HTTP client and respect <code>NO_PROXY<\/code> for their endpoints. Some n8n documentation pages still describe older behavior, where Gemini and Ollama ignored the proxy and the Azure node ignored <code>NO_PROXY<\/code>; on older versions those limitations may still apply.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That reverses the advice in older guides: a local Ollama server now goes through the external proxy unless its hostname is in <code>NO_PROXY<\/code>. Use the exact host from the Ollama credential&#8217;s Base URL, such as <code>ollama<\/code> for a Compose service or <code>host.docker.internal<\/code> for Ollama running on the host itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Code node is the exception to know about. Requests made with <code>fetch()<\/code> inside a Code node don&#8217;t go through the proxy, so they leave from the VPS&#8217;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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"N8N_PROXY_HOPS_the_setting_people_confuse_with_an_outbound_proxy\"><\/span>N8N_PROXY_HOPS: the setting people confuse with an outbound proxy<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>N8N_PROXY_HOPS<\/code> 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 <code>X-Forwarded-For<\/code>, <code>X-Forwarded-Host<\/code> and <code>X-Forwarded-Proto<\/code> headers set by reverse proxies in front of it, so that n8n sees the real visitor&#8217;s IP and knows the original request used HTTPS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Behind a single Nginx or Traefik instance, n8n&#8217;s documentation recommends <code>N8N_PROXY_HOPS=1<\/code> together with <code>N8N_WEBHOOK_URL<\/code> set to your public URL, such as <code>https:\/\/n8n.example.com\/<\/code>. On versions before 2.30.0, use <code>WEBHOOK_URL<\/code> 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 <code>X-Forwarded-For<\/code> headers straight to n8n. Setting <code>N8N_PROXY_HOPS<\/code> never changes the IP your workflows use to call external APIs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Troubleshooting_n8n_proxy_errors\"><\/span>Troubleshooting n8n proxy errors<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Symptom<\/th><th>Likely cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td>The IP check still shows the VPS address<\/td><td>Container not recreated, or a lowercase variable overrides the new one<\/td><td>Run <code>docker compose up -d<\/code>; check <code>env<\/code> output inside the container<\/td><\/tr><tr><td>HTTP APIs go through the proxy, HTTPS APIs don&#8217;t<\/td><td>Only <code>HTTP_PROXY<\/code> is set<\/td><td>Add <code>HTTPS_PROXY<\/code> with the same proxy URL<\/td><\/tr><tr><td><code>407 Proxy Authentication Required<\/code><\/td><td>The URL points to the login port 8080 without credentials<\/td><td>Use the allowlist port 8085, or add the login and password to the proxy URL as in Step 3<\/td><\/tr><tr><td><code>ECONNREFUSED<\/code> or timeouts when connecting to the proxy<\/td><td>Wrong IP or port, or the VPS&#8217;s current IP isn&#8217;t on the allowlist, often after a server move<\/td><td>Check the address and port in the dashboard; run the <code>curl -x<\/code> test from Step 1<\/td><\/tr><tr><td><code>EPROTO<\/code> or TLS errors on every proxied request<\/td><td>The proxy URL starts with <code>https:\/\/<\/code><\/td><td>Use <code>http:\/\/<\/code> for the proxy URL, even for HTTPS targets<\/td><\/tr><tr><td>Calls to your own webhooks or internal services are slow or fail<\/td><td>Their hostname isn&#8217;t in <code>NO_PROXY<\/code> exactly as it appears in the URL<\/td><td>Add the exact hostname, or a leading-dot domain, to <code>NO_PROXY<\/code><\/td><\/tr><tr><td>The Ollama node fails after you add a proxy<\/td><td>The Ollama host isn&#8217;t in <code>NO_PROXY<\/code>, so requests go to the external proxy<\/td><td>Add the host from the Ollama credential&#8217;s Base URL<\/td><\/tr><tr><td>One workflow uses a different IP than the rest<\/td><td>The HTTP Request node has its own Proxy option set<\/td><td>Check the node&#8217;s options; it overrides the environment variables<\/td><\/tr><tr><td><code>fetch()<\/code> calls from a Code node show the VPS address<\/td><td><code>fetch()<\/code> in the Code node doesn&#8217;t use the proxy variables<\/td><td>Move the request into an HTTP Request node<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_a_proxy_adds_to_your_setup\"><\/span>What a proxy adds to your setup<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A proxy is one more dependency, so know what you take on:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The provider sees which hosts your workflows connect to, plus timing and volume. For HTTPS targets it doesn&#8217;t see request contents, headers or API keys, because TLS runs end to end inside the tunnel; plain <code>http:\/\/<\/code> requests are visible in full.<\/li>\n\n\n\n<li>Don&#8217;t install a provider&#8217;s certificate or disable TLS verification, for example with <code>NODE_TLS_REJECT_UNAUTHORIZED=0<\/code>, to make a proxy work. A forward proxy for n8n needs neither.<\/li>\n\n\n\n<li>Every proxied request takes an extra hop, which adds latency, especially when the proxy and the API are on different continents.<\/li>\n\n\n\n<li>If the proxy is down or the allowlist is out of date, proxied nodes fail; n8n doesn&#8217;t fall back to a direct connection.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Checklist_before_you_rely_on_a_proxy_in_production\"><\/span>Checklist before you rely on a proxy in production<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Decide whether the proxy should apply to all nodes or only to specific HTTP Request nodes.<\/li>\n\n\n\n<li>Allowlist your VPS&#8217;s IPv4 address with the proxy provider, use the allowlist port, and test it with <code>curl -x<\/code> before changing n8n.<\/li>\n\n\n\n<li>Set both <code>HTTP_PROXY<\/code> and <code>HTTPS_PROXY<\/code>, and list every internal hostname in <code>NO_PROXY<\/code> exactly as it appears in URLs.<\/li>\n\n\n\n<li>Recreate the container, and the workers in queue mode, then confirm the exit IP with an HTTP Request node.<\/li>\n\n\n\n<li>Test each AI node you use, and keep local model servers out of the proxy with <code>NO_PROXY<\/code>.<\/li>\n\n\n\n<li>Recheck the exit IP after upgrades and server migrations.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2993,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-2992","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/posts\/2992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/comments?post=2992"}],"version-history":[{"count":1,"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/posts\/2992\/revisions"}],"predecessor-version":[{"id":2994,"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/posts\/2992\/revisions\/2994"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/media\/2993"}],"wp:attachment":[{"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/media?parent=2992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/categories?post=2992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/extendsclass.com\/blog\/wp-json\/wp\/v2\/tags?post=2992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}