Hello everyone
I installed n8n on my VPS server using a docker container in conjunction with the nginx reverse proxy image “jwilder/nginx-proxy:latest”.
There my server configuration on docker-composes:
- nginx-proxy docker-compose.yml
version: "3"
services:
reverse-proxy:
image: "jwilder/nginx-proxy:latest"
container_name: "reverse-proxy"
volumes:
- "./html:/usr/share/nginx/html"
- "./dhparam:/etc/nginx/dhparam"
- "./vhost:/etc/nginx/vhost.d"
- "./certs:/etc/nginx/certs"
- "/run/docker.sock:/tmp/docker.sock:ro"
- "/srv/reverse-proxy/proxy.conf:/etc/nginx/conf.d/proxy.conf:ro"
restart: "always"
networks:
- "net"
ports:
- "80:80"
- "443:443"
letsencrypt:
image: "jrcs/letsencrypt-nginx-proxy-companion:latest"
container_name: "letsencrypt-helper"
volumes:
- "./html:/usr/share/nginx/html"
- "./dhparam:/etc/nginx/dhparam"
- "./vhost:/etc/nginx/vhost.d"
- "./certs:/etc/nginx/certs"
- "/run/docker.sock:/var/run/docker.sock:ro"
environment:
NGINX_PROXY_CONTAINER: "reverse-proxy"
DEFAULT_EMAIL: "[email protected]"
restart: "always"
depends_on:
- "reverse-proxy"
networks:
- "net"
volumes:
certs:
html:
vhost:
dhparam:
networks:
net:
external: true
- My n8n docker-compose.yml
version: "3"
services:
n8n:
image: n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER
- N8N_BASIC_AUTH_PASSWORD
- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- WEBHOOK_TUNNEL_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- VUE_APP_URL_BASE_API=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- VIRTUAL_HOST=n8n.mydomain.com
- LETSENCRYPT_HOST=n8n.mydomain.com
volumes:
- ${DATA_FOLDER}/.n8n:/home/node/.n8n
- ./local-files:/files
networks:
default:
external:
name: net
- My n8n .env file
# Folder where data should be saved
DATA_FOLDER=/srv/n8n/local-files
# The top level domain to serve from
DOMAIN_NAME=mydomain.com
# The subdomain to serve from
SUBDOMAIN=n8n
# DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from
# above example would result in: https://n8n.example.com
# The user name to use for authentication - IMPORTANT ALWAYS CHANGE!
N8N_BASIC_AUTH_USER=login
# The password to use for authentication - IMPORTANT ALWAYS CHANGE!
N8N_BASIC_AUTH_PASSWORD=pass
# Optional timezone to set which gets used by Cron-Node by default
# If not set New York time will be used
GENERIC_TIMEZONE=Europe/Minsk
# The email address to use for the SSL certificate creation
[email protected]
Now I can go to the n8n page at n8n.mydomain.com.
But when I set up a workflow using a webhook, it does not work at the copied address either in the test or in the production link.
I also tried sending a get request to the local host and this is what came out of it:
How to make the webhook work at my external address https://n8n.mydomain.com/…?
Any help would be helpful