We’re facing an issue with running test workflows in n8n when it’s self-hosted via Docker

We’re facing an issue with running test workflows in n8n when it’s self-hosted via Docker with SSL enabled, accessed through an Apache reverse proxy. The problem arises specifically when n8n is configured with SSL – the test workflows fail to execute properly and remain stuck in a loading state indefinitely. However, when SSL is disabled, the workflows function as expected.

Please find the some bit of configuration.

<VirtualHost *:443>
ServerName example.com
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /path/to/your/fullchain.pem
SSLCertificateKeyFile /path/to/your/privkey.pem
ProxyPreserveHost On

# Main proxy settings
ProxyPass / http://localhost:5678/
ProxyPassReverse / http://localhost:5678/

# WebSocket proxying
ProxyPassMatch /rest/push ws://localhost:5678/rest/push
ProxyPassReverse /rest/push ws://localhost:5678/rest/push

# Add additional headers
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Ssl "on"
<Proxy *>
    Require all granted

# Enable detailed logging
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/n8n_error.log
CustomLog ${APACHE_LOG_DIR}/n8n_access.log combined

We are facing WebSocket error.
WebSocket connection to ‘wss://your-server.com/rest/push?pushRef=your-pushRef’ failed:

Request you to kindly guide us.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Shubham_Takalikar,

Looking a the error message you will need to configure your web server to support websockets as well. For Apache2 my notes have the below configuration as an example for something that works so you would need to adapt your configuration to support the options.

<VirtualHost *:80>
        ServerName n8n.yourdomain.tld

        RewriteEngine On
        RewriteCond %{HTTP:Upgrade} =websocket [NC]
        RewriteRule /(.*)           ws://$1 [P,L]
        RewriteCond %{HTTP:Upgrade} !=websocket [NC]
        RewriteRule /(.*) $1 [P,L]
        ProxyPassReverse /          http://n8n.yourdomain.tld

@Jon I have also added this conf file but still showing websocket error.
do you have the combined configuration example where we can handle the websocket connections as well or else can you please made some changes in my example conf code and send it to me.

Hey @Shubham_Takalikar,

Sadly I am not that familar with Apache2 so we need to rely on your experience there as it is not an n8n component.

When it comes to self hosting as it is an advanced configuration option we make an assumption that you have the knowledge or team in place to manage the environment including configuring any software that may be needed.

One thing that could be worth noting is that you don’t need anything else other than what I have included so if you wanted to add SSL to it you would use

<VirtualHost *:443>
        ServerName n8n.yourdomain.tld
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /path/to/your/fullchain.pem
        SSLCertificateKeyFile /path/to/your/privkey.pem

        RewriteEngine On
        RewriteCond %{HTTP:Upgrade} =websocket [NC]
        RewriteRule /(.*)           ws://$1 [P,L]
        RewriteCond %{HTTP:Upgrade} !=websocket [NC]
        RewriteRule /(.*) $1 [P,L]
        ProxyPassReverse /          http://n8n.yourdomain.tld

hello Jon,
the Configuration you gave it works and the workflow is executng, but when we intergrate n8n with Ms teams, it giving “err_ssl_protocol_error”
we have created Azure app for n8n putting the OAuth Redirect URL taken from n8n and this the URL that give me the error this error “err_ssl_protocol_error”
adding screen shot.

can you please guide us.

Hey @Shubham_Takalikar,

You are using port 5678 which probably isn’t listening for https traffic. Make sure you have WEBHOOK_URL set correctly.

Hello Jon.
We have set the Webhook URL still showing the same Error.
we have configured conf file using your given configuration in above chats.

#curl -v https://n8n.example.com:5678/

  • Trying [IP Address]…
  • Connected to n8n.example.com ([IP Address]) port 5678 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /etc/pki/tls/certs/ca-bundle.crt
    CApath: none
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • error:1408F10B:SSL routines:ssl3_get_record:wrong version number
  • Closing connection 0
    curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

we are getting this error when we run curl command.we encountering an SSL/TLS issue while trying to connect to my n8n instance running on port 5678. Despite configuring n8n to use HTTPS.
Is this is the issue that we cant able to connect or intergrate n8n with Ms teams ?

Hello @Jon
can you please guide us on this issue.