Apache2 + node-red + proxypass NO DEBUG DATA

using v1.0.3
on rpi 4b newest rassbian lite
over internet (https + password)
i have got set my domain on duckdns org
everything works like a charm when i am connecting to my node-red through
https://example.duckdns.org:1880
then i created virtual host in apache to maintain my node-red through subdomain like
https://node-red.example.duckdns.org
and it looks like everything works like a charm but i dont get any debug data!
a have tried everything
here's my config file in apache

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName node-red.example.duckdns.org
        ServerAlias www.node-red.example.duckdns.org
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        Include /etc/letsencrypt/options-ssl-apache.conf

        SSLEngine On
        SSLProxyEngine On
        SSLProxyVerify none
        SSLProxyCheckPeerCN off
        SSLProxyCheckPeerName off
        SSLProxyCheckPeerExpire off

        ProxyRequests Off
        ProxyPreserveHost On

        ProxyPass /comms wss://example.duckdns.org:1880/comms
        ProxyPassReverse /comms wss://example.duckdns.org:1880/comms

        ProxyPass / https://example.duckdns.org:1880/
        ProxyPassReverse / https://example.duckdns.org:1880/

        SSLCertificateFile /etc/letsencrypt/live/example.duckdns.org-0001/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.duckdns.org-0001/privkey.pem
</VirtualHost>
</IfModule>


NOTE: sometimes it magicaly works but usually its like this

I haven't used Apache in a long time but I think you might be missing the websockets proxy?

I am getting lost connetion with RewriteEngine sollution. With proxy_wstunnel (which i used)

ProxyPass /comms wss://example.duckdns.org:1880/comms
ProxyPassReverse /comms wss://example.duckdns.org:1880/comms

i am not getting any errors but nothing in debug info.

OK, I may be steering you wrong anyway. I just had a quick look and I realise that I don't think the debug data takes the path that I thought it did. I'd need to look at the connection to my Pi to see what is happening. Unfortunately, I need to do some paid work just now :frowning: I'll try to look at it later unless someone else has been able to help by then.

I'm assuming that you are running the NR Editor across the Internet with the NR server running on your local network?

If that is the case, unless you are outputting debug to the NR log as well as the sidebar, I don't think it leaves the browser? So it is possible that it isn't a network issue and you should certainly check the browser's dev console to see if there are errors there.

Yeah i am running NR on my local network. I set debug node to output info to system console as well to debug window and i am getting timestamp on node-red-log but nothing on browser debug window... This is really confusing. After sometime it works and debug data is in debug window but its not predictible

I discovered something. When i was on my node-red site and i restarted my apache2.
Client calls for wss://node-red.example.duckdns.org/comms
After that everything works fine. Why i must wait for it in normal environment.


and when i first connect to node-red i got this (pending state):

I gave up on apache2 and switched to nginx and everything works flawlessly!
here's my script

server {
        listen 443 ssl;
        server_name node-red.example.duckdns.org www.node-red.example.duckdns.org;
        ssl_certificate /etc/letsencrypt/live/example.duckdns.org/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.duckdns.org/privkey.pem;

        location / {
                proxy_pass https://example.duckdns.org:1880;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }
}
1 Like

Good call, a much better tool anyway :slight_smile:

2 Likes

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