Describe the problem/error/question
Hi i setup n8n running inside docker, and reverse proxy nginx using let’s encrypt.
But when i access n8n direct by ip and port 5678 workflow excute working. But if i access via domain it not working (image)
This is my docker-compose file and setting nginx. I follow all docs nginx in community but i does’nt help.
version: '3'
services:
n8n:
image: n8nio/n8n
container_name: n8n
restart: always
ports:
- 5678:443
environment:
- N8N_HOST=auto2.test.online
- N8N_PORT=443
- N8N_PROTOCOL=https
- WEBHOOK_TUNNEL_URL=https://auto2.test.online/
- WEBHOOK_URL=https://auto2.test.online/
- VUE_APP_URL_BASE_API=https://auto2.test.online/
volumes:
- ./n8n_data:/home/node/.n8n
Nginx config:
server {
server_name auto2.test.online; # managed by Certbot
location / {
proxy_pass http://localhost:5678;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
}
location ~ ^/(webhook|webhook-test) {
proxy_set_header Connection '';
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_pass http://localhost:5678;
}
client_max_body_size 0;
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/auto2.test.online/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/auto2.test.online/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = auto2.test.online) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 ;
listen [::]:80 ;
server_name auto2.test.online;
return 404; # managed by Certbot
}