Port appear in OAuth Redirect URL

Port appear in OAuth Redirect URL

Why does the n8n OAuth Redirect URL include a port number?

I want to create a credential for microsoft excel 365 .
In the config n8n give me this URL in OAuth Redirect: https://n8n.mysite.com:5678/rest/oauth2-credential/callback
I installed n8n with npm
This is my nginx config:

    server {

    server_name n8n.mysite.com;

    proxy_connect_timeout       1200;
    proxy_send_timeout          1200;
    proxy_read_timeout          90m;
    send_timeout                1200;

    client_max_body_size 5G;

    add_header Access-Control-Allow-Origin *;

    location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto https;
            proxy_set_header X-Forwarded-Port 443;
            proxy_set_header Host $host;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_http_version 1.1;
            chunked_transfer_encoding off;
            proxy_buffering off;
            proxy_cache off;


listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/n8n.mysite.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/n8n.mysite.com/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 = n8n.mysite.com) {
    return 301 https://$host$request_uri;
} # managed by Certbot

    server_name n8n.mysite.com;
listen 80;
return 404; # managed by Certbot

I have add n8n to supervisor and this is the config:

command=n8n start

Hi @Aymen_Kmar, welcome to the community!

I can see that you are setting the WEBHOOK_TUNNEL_URL environment variable. This environment variable is no longer supported since v1. Can you replace it with WEBHOOK_URL? This lets you set the URL used by n8n for webhooks but also for Oauth2 redirects.


Hi @MutedJam
The port number is no longer displayed in the URL
Thank you very much

1 Like

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