N8n on Azure App Service container - reverse proxy issue

Dear All,
I have created a new n8n instance on an Azure App Service container using the image n8nio/n8n:latest. Overall, it works fine, but I noticed an issue in the log file related to reverse proxy—specifically, client IP address forwarding.
As you will see, I tried the recommended settings such as N8N_PROXY_HOPS=1 and TRUST_PROXY=true.

I tested several different parameter configurations, but without success. I would greatly appreciate any advice or assistance on this matter.

Error message

2025-11-25T08:10:46.6921334Z ValidationError: An invalid ‘request.ip’ (#.#.#.#:50104) was detected. Consider passing a custom ‘keyGenerator’ function to the rate limiter. See Page Redirection for more information.

2025-11-25T08:10:46.6922429Z at Object.ip (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected][email protected]/node_modules/express-rate-limit/dist/index.cjs:152:13)

2025-11-25T08:10:46.6922516Z at Object.wrappedValidations. [as ip] (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected][email protected]/node_modules/express-rate-limit/dist/index.cjs:398:22)

2025-11-25T08:10:46.6922589Z at Object.keyGenerator (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected][email protected]/node_modules/express-rate-limit/dist/index.cjs:669:20)

2025-11-25T08:10:46.6922659Z at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected][email protected]/node_modules/express-rate-limit/dist/index.cjs:724:32

2025-11-25T08:10:46.6922736Z at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected][email protected]/node_modules/express-rate-limit/dist/index.cjs:704:5 {

2025-11-25T08:10:46.6922783Z code: ‘ERR_ERL_INVALID_IP_ADDRESS’,

2025-11-25T08:10:46.6922839Z help: ‘ Page Redirection

My n8n setup

  • n8n version: Version: 1.120.4
  • Database (default: SQLite): default: SQLite
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Azure Service App container / Web App
  • Operating system: Linux

environment-variables

DB_SQLITE_POOL_SIZE=4
EXPRESS_SET_PROXY=true
GENERIC_TIMEZONE=Europe/Berlin
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
N8N_HOST=app-XXXXXXXXXX.westeurope-01.azurewebsites.net
N8N_LISTEN_ADDRESS=0.0.0.0
N8N_PORT=5678
N8N_PROTOCOL=https
N8N_PROXY_HOPS=1
N8N_RUNNERS_ENABLED=true
PORT=5678
TRUST_PROXY=true
WEBHOOK_URL=https://app-XXXXXXXXXX.westeurope-01.azurewebsites.net
WEBSITES_CONTAINER_START_TIME_LIMIT=1200
WEBSITES_ENABLE_APP_SERVICE_STORAGE=true
WEBSITES_PORT=5678

You need to ensure your front-end (Azure App Service / App Service front-end or any custom reverse proxy in front of the container) forwards at least:

  • X-Forwarded-For

  • X-Forwarded-Host

  • X-Forwarded-Proto

This is required so n8n can correctly interpret client IPs and scheme/host behind a proxy.
You can read more on the documentation page here [Webhook behind proxy].

2 Likes

@Mutasem , many thanks for your response and advice, but most of all for inspiring me. The root cause of the issue was that I had imported a flow from another environment, which still contained an unedited webhook.

Unfortunately, I didn’t expect that opening the imported flow would trigger some kind of validation. Once I removed the flow, the error disappeared.

Kind regards

1 Like

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