That is more of a personal preference, If I am setting up nginx to run as a reverse proxy I just create a file called proxy_hosts and unlink / remove the defaults and do everything that way but there isn’t really a right or wrong answer and it depends on what you feel comfortable doing.
i have n8n,pm2 ,certbot and nginx. The signed certificate is in the letsencrypt folder. Through pm2, I run n8n and everything works on ip-localhost: 5678, I can’t connect nginx to this construct …
You would set up your nginx proxy to connect to localhost 5678, The example config file @MutedJam has provided should do the job.
configured according to the instructions above, launched nginx and pm2 start n8n … nginx status in the screenshot, but I still can’t log in using https://subd.exampl.xyz
What happens when you try and login?
Hello, friends.
In 2024 I got the same error in receiving requests in the Webhoock test flow on the N8N, which prevented me from continuing with the tests and configurations in the flow.
-
My environment: Ubuntu, Nginx, Docker Compose
-
File variables .env
DOMAIN_NAME=“seudominio.com.br”
SUBDOMAIN=“n8n”
N8N_HOST=“${SUBDOMAIN}.${DOMAIN_NAME}”
WEBHOOK_URL=“https://${SUBDOMAIN}.${DOMAIN_NAME}/”
N8N_PORT=“443”
N8N_PROTOCOL=“https”
GENERIC_TIMEZONE=“America/Bahia”
WEBHOOK_TUNNEL_URL=“https://n8n.seudominio.com.br/”
VUE_APP_URL_BASE_API=“https://n8n.seudominio.com.br/” -
Settings NGINX
location / {
proxy_pass http://localhost:5678;
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_set_header Connection ‘’;
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_connect_timeout 300s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
proxy_cache off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
}
We try to keep support to English only to allow more users (including ourselves) to respond without having to translate and possibly miss something useful.
Looking at your nginx config try using just the below and see if that works.
location / {
proxy_pass http://localhost:5678;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
}
Ok, I updated the comment.
In my opinion, only the Upgrade and Connection proxy was not enough. Maybe it could be the same situation for some others. Thank you for your attention!
This option worked for me because the new version of N8N needs to be updated
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
