Module 2 Lesson 2: Reverse Proxy (SSL)
·Automation

Module 2 Lesson 2: Reverse Proxy (SSL)

Secure your connection. Learn how to put n8n behind a reverse proxy like Nginx or Traefik to enable HTTPS and clean domain names (e.g., n8n.mycompany.com).

Module 2 Lesson 2: Reverse Proxy (SSL)

Running n8n on http://localhost is fine for testing. But to receive "Webhooks" from the internet (like Slack or Stripe), your server must be reachable via HTTPS with a valid domain name.

1. What is a Reverse Proxy?

A reverse proxy sits in front of your n8n container.

  1. It listens on Port 443 (HTTPS).
  2. It handles the SSL certificates (via Let's Encrypt).
  3. It passes the traffic securely to n8n on Port 5678.

2. Using Nginx Proxy Manager (The Easy Way)

Nginx Proxy Manager is a web interface for Nginx.

  1. Run it as a Docker container.
  2. Add a "Proxy Host": n8n.yourdomain.com.
  3. Point it to your n8n container's IP/Hostname.
  4. Click "Request a new SSL Certificate."

3. The WEBHOOK_URL Environment Variable

Once you have a domain, you MUST tell n8n about it. If you don't, webhooks from other apps will try to send data to localhost and fail.

environment:
  - WEBHOOK_URL=https://n8n.yourdomain.com/

4. Traefik (The Pro Way)

If you are comfortable with YAML, Traefik can automatically detect your n8n container and setup the SSL without you ever touching a dashboard. This is the preferred method for "Infrastructure as Code" fans.


Exercise: The Secure Portal

  1. Point a domain (e.g., n8n.mytest.com) to your server's IP address.
  2. Setup a Reverse Proxy (Nginx or Traefik).
  3. Update your WEBHOOK_URL and restart n8n.
  4. Visit your domain. Does the "Lock" icon appear in the browser address bar?
  5. Why is it dangerous to run n8n without HTTPS? (Think about your API keys!).

Summary

A reverse proxy turns your local tool into a global platform. By securing your connection with SSL, you ensure that your automation can safely talk to the rest of the world and receive events as they happen.

Next Lesson: Tuning the engine: Environment Variables for n8n.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn