Nginx reverse proxy

Hello guys.i have installed nginx and now i want to use n8n as a subfolder in it.
I am running on linux 20.04 and using Docker. the browser loads the page ( site.com/n8n), the title of the page is n8n, but the page is white blank. shows nothing.

here are my conf files :
docker :

docker run -d \
	--name n8n \
	--restart=always \
	-e WEBHOOK_URL=https://site.com/n8n/ \
	-e N8N_HOST=site.com/n8n/ \
	-e VUE_APP_URL_BASE_API=https://site.com/n8n/ \
	-e N8N_PROTOCOL=https \
	-e N8N_PORT=5678 \
	-p 127.0.0.1:5678:5678 \
	n8nio/n8n

and nginx .conf:

location /n8n/ {
    proxy_pass              http://127.0.0.1:5678;
    proxy_http_version      1.1;
    proxy_set_header Connection '';
    proxy_buffering off;
    proxy_cache off;
    chunked_transfer_encoding off;

    auth_basic "What's the password?";
    auth_basic_user_file /etc/htpasswd;

}

thank you.

I have never done it, but here you find GitHub - linuxserver/reverse-proxy-confs: These confs are pulled into our SWAG image: https://github.com/linuxserver/docker-swag many proxy confs for subdomain and subfolder (_template as a general), which you can model. n8n has only subdomain there but I assume you can do it from the template.

thank you. i had to use subdomain instead of subfolder for n8n : n8n.domain.com

now everything works except one thing. the jobs that need webhook url, like telegram trigger. doesn’t work.

Try setting
WEBHOOK_URL
See Environment variables - n8n Documentation

1 Like

i have set that. and https is working too.

i dont know why it doesnt work.
any option should i add to nginx conf file ?

nginx conf
We use an edited version of the above, hope it helps.

2 Likes

thank you very much.
so i had to add webhook url to nginx conf file too !

it worked ! all triggers works too !

may you help me pls with webtop too ?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.