N8n Integration with existing app (Django)

Problem -
I am integrating n8n in my sample project (technologies are mentioned below). Till now I have changed the default database Sqlite to PostgreSQL. Now I want to make n8n URL http://localhost:5678 to https://domain-name:5678. How I can use Nginx and configure n8n so it will be dockerized in my existing backend container?

As is set up -
Frontend - Angular(dockerized)
Backend - Nginx over gunicorn server Django application (dockerized)
Database - PostgreSQL(dockerized)
Frontend, backend and database are separately dockerized.
n8n - via npm .

To-be what i want:
Frontend - Angular(dockerized)
Backend - Nginx over gunicorn server Django application + n8n(in one docker compose.yml file)
Database - PostgreSQL(dockerized)

Also,Is there any document on how to host n8n on any server?

Information on n8n setup

  • n8n version: 0.185.0
  • Database you’re using (default: SQLite): PostgreSQL
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: currently npm

Hey @Pooja_Samudre,

The quick version is you will need to set the WEBHOOK_URL environment option to something like https://domain-name:5678 from there it would be a case of setting up your nginx reverse proxy like normal so something like…

server {
  listen 5678 ssl;
  server_name domain-name;
  location / {
    proxy_pass http://127.0.0.1:5678;
    proxy_set_header Connection '';
    proxy_http_version 1.1;
    chunked_transfer_encoding off;
    proxy_buffering off;
    proxy_cache off;
  }
  ssl_certificate # removed
  ssl_certificate_key # removed
}