not wanting to sound as dumb as I am… but where is the httpd config file
I don’t know in your environment or anything about aapanel - is there an apache setting option on it ? (Or NGINX ?) Try that.
It’s typically /www/server/panel/vhost/apache
I have access to a file that says:
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/www/server/apache/logs/access_log", whereas "/logs/access_log"
# will be interpreted as '/logs/access_log'.
Is that the right one?
Yes
Still getting the issue
just reinstalling Nginx, hope fully that may help…
so this is the config of the reverse proxy (running Nginx now)
location ^~ /
{
proxy_pass http://127.0.0.1:8024;
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 REMOTE-HOST $remote_addr;
#Persistent connection related configuration
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
set $static_fileNnYBDePU 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_fileNnYBDePU 1;
expires 12h;
}
if ( $static_fileNnYBDePU = 0 )
{
add_header Cache-Control no-cache;
}
}
#PROXY-END/
Some worthwhile reading when it’s in place to ensure ws are routed correctly
I did look at that, but the whole thing is run in a docker container, not sure if that makes a difference
Configuration for when you are behind a reverse proxy: Behind a reverse proxy | Socket.IO
Does it work with an unsecure connection over http? The wss is the secure protocol and need a valid certificate.
its using an Origin Cert from cloud flare, @Patrick will that be ok or cause issues?
For what it is worth, here is another config for apache that I know works (albeit without docker involved):
ProxyRequests Off
ProxyPass /errors/ !
ErrorDocument 503 /errors/503.html
ProxyPass / http://localhost:3000/ timeout=300 Keepalive=On
ProxyPassReverse / http://localhost:3000/
RequestHeader set X-Forwarded-Proto https
ProxyPreserveHost On
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
- Use a valid SSL certificate for your domain(s) at your origin host/server, or use generate and use Cloudflare Origin CA certificate
- If so, make sure SSL/TLS option is set to Full (Strict) SSL
- Check and enable WebSockets at Cloudflare dashboard
- Use WSS in your web app for WebSocket connections
- Use one of the supported and compatible ports with Cloudflare proxy mode
Seems you have to enable Websockets in the dashboard when using Cloudflare Origin CA certificates.
so all that is done, but how can I specify what port socket.io uses in the Wappler code?
OK so it seems to be working correctly on local server.
However on the remote server it is not getting an update I have set up
Local Server Response:
Remote Server Response:
As you can see on the remote sever it is not returning the update.
What is the node version that Wappler sets the local node site to and which one Alpine or Debian?
I’m just wondering if this could be the issue…
On the plus side the socket is working
You can set the node version you want in settings
Just come across a similar issue…I’m using a VPS with Plesk installed and deploying a Node JS app with websockets. It was working fine on local, when deployed to VPS server I got:
'websocket.js:54 WebSocket connection to 'wss://DOMAINNAME?EIO=4&transport=websocket' failed
Not sure if the issue was resolved from this thread but I found this worked for me:
https://support.plesk.com/hc/en-us/articles/360000739853-Does-Node-js-on-Plesk-Onyx-support-WebSockets-socket-io-
In Plesk proxy mode under nginx settings is checked by default, remove this and the websockets work fine: