• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Resolved N8N in docker : ERR_ERL_UNEXPECTED_X_FORWARDED_FOR

soft009

New Pleskian
Server operating system version
Ubuntu 22.04
Plesk version and microupdate number
18.0.73 #3
I have create n8n docker container and access through sub domain. After I login to the n8n workflow i am getting "connection Lost" error. when i check the docker container logs I found below error,
ValidationError: The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). This could indicate a misconfiguration which would prevent express-rate-limit from accurately identifying users. See Page Redirection for more information.

I have update Additional nginx directives as well.

location / {
proxy_pass http://127.0.0.1:32779;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

Appreciate, if any one have idea how to resolve this issue.
Thank you.
 
try set docker variables N8N_TRUST_PROXY and if needed N8N_PROXY_HOPS
 
try set docker variables N8N_TRUST_PROXY and if needed N8N_PROXY_HOPS
Thank you. Adding N8N_PROXY_HOPS solve the issue.
 
I have a similar problem with n8n. I want to add the following to nginx directives:

Code:
location / {
    proxy_pass http://127.0.0.1:5678;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_cache_bypass $http_upgrade;
    proxy_read_timeout 300s;
    proxy_connect_timeout 75s;
}

Invalid nginx configuration:
nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/n8n.mydomain.com/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed

This error message means that the location/directive is already defined elsewhere in the nginx configuration. This is probably from the default configuration. How can I set the proxy_pass variable correctly?

Ubuntu 20.04
Plesk Obsidian 18.0.74
 
Invalid nginx configuration:
nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/n8n.mydomain.com/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed

Disable "Proxy Mode" on the domain first and click save. Afterwards you should be able to add the additional nginx directives with the / location block.
 
I have pulled n8n version 2.3.5 and I have the same issue with "Connection lost". I disabled nginx setting, Proxy mode and add the additional ngnix directives:
Code:
location /n8n/ {
    proxy_pass http://localhost:5678/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}


Environment variables in docker:
N8N_HOST: mydomain.com
WEBHOOK_URL: https://mydomain.com
N8N_PORT: 5678
N8N_PROTOCOL:https
N8N_PROXY_HOPS:1
N8N_TRUST_PROXY:true
 
Back
Top