• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

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.
 
Back
Top