Issue with certbot SSL after installing on oracle cloud

Describe the problem/error/question

Succesfully installed n8n with nginx following the video on Oracle Cloud VPS: n8n Workflow Automation tool - YouTube.
It worked well on port 5678 of my no-ip fqdn, but when i tried to install certbot let’s encrypt SSL, it was successfully installed, but when opening my domain, on https n8n loses connection to the server.
When i open on port 5678 it opens right, but with no SSL connection.

What can i have done wrong?

Ports checked and ok, oracle firewall ok too.

error log on nginx:
2023/07/30 19:09:27 [error] 93821#93821: *76 connect() failed (111: Unknown error) while connecting to upstream, client: xxx.xxx.xxx.196, server: xxxxx.viewdns.net, request: “GET /rest/push?sessionId=qamyzjdrit8 HTTP/1.1”, upstream: “http://127.0.0.1:5678/rest/push?sessionId=qamyzjdrit8”, host: “xxxxx.viewdns.net

Hi @guispiller, I am afraid I am not familiar with this tutorial and the setup it uses.

Are you by any chance using docker for either n8n or nginx? If so, nginx might not be able to talk to n8n at 127.0.0.1.

If not, how exactly are you running both n8n and nginx?

Hey there

Sorry, i’m using npm, i’ve found some posts about this same issue on 2020, it seems to be something like this: Connection lost - #60 by rafas.

Using reverse proxy on nginx, I got some problems even before getting to SSL, now i found that.

So my issue is i’ve succesfully installed n8n via npm, but when installing reverse proxy for nginx i got gonnection lost from n8n UI.

thats my nginx reverse-proxy.conf:

server {
listen 80;
listen [::]:80;

server_name xxxx.viewdns.net;

access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;

location / {
    proxy_pass http://127.0.0.1:5678;
    proxy_set_header Host $host;
    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 $scheme;

    proxy_set_header Connection '';
    proxy_http_version 1.1;
    chunked_transfer_encoding off;
    proxy_buffering off;
    proxy_cache off;
}

}

Hi @guispiller, assuming you are using n8n version 1 or later check out this post from @alex_st sharing a fully working nginx config:

In particular, you would need to specify the upgrade mechanism to allow upgrading a HTTP connection to a websocket connection:

Hope this helps :slight_smile:

2 Likes

That worked perfectly!

Thank you very much for the reply and for your time.

In time, sorry for the lack of knowledge on how to be more exactly on asking questions, i’m kinda new to this community.

Thank you!

1 Like

Amazing, glad to hear it worked! Also, no need to be sorry, I think pretty much everyone on this forum (myself included) learns something new every day. That’s what the community is for :slight_smile:

1 Like

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