in 1.5.0 entering www. gives error "Looks like your connection to [sitename] was lost, please wait while we try to reconnect."
-
@PitaJ said in in 1.5.0 entering www. gives error "Looks like your connection to [sitename] was lost, please wait while we try to reconnect.":
The best solution is to just redirect users from
www.example.com
toexample.com
instead of serving NodeBB on both. This error is due to the origin restrictions we added as a security fix. On nginx this redirect is done like so:return https://example.com 301;
where must I add this? In the ACP?
-
No it's added in your nginx config. It should actually be like what julian said above, though.
-
@PitaJ said in in 1.5.0 entering www. gives error "Looks like your connection to [sitename] was lost, please wait while we try to reconnect.":
No it's added in your nginx config. It should actually be like what julian said above, though.
How do I change the nginx config?
I'm sorry I ask a lot, but this s totally new for me.. -
How did you set up NodeBB in the first place? The nginx config is located at
/etc/nginx/sites-available/
and will be called something likenodebb
orexample.com
-
@PitaJ said in in 1.5.0 entering www. gives error "Looks like your connection to [sitename] was lost, please wait while we try to reconnect.":
How did you set up NodeBB in the first place?
A friend of me did, but I'm trying to do every time a little bit more myself... well... with a lot of help from you guys
@PitaJ said in in 1.5.0 entering www. gives error "Looks like your connection to [sitename] was lost, please wait while we try to reconnect.":
The nginx config is located at /etc/nginx/sites-available/ and will be called something like nodebb or example.com
Thank you, I go try
-
I can't see it. I looked in
/etc/
/usr/local/
/usr/local/etc/but I can't find a folder of nginx.
If I check my website on https://builtwith.com I can't see Nginx also.
See yourself https://builtwith.com/keen.wtf
Does it mean I don't have Nginx installed?
-
@MJ most likely, yes. You could be using apache or something else instead, or possibly nothing. Did you set up the DNS records? It could also possibly just have NodeBB running on port 80 and use DNS records.
-
I did the nginx config and setup my DNS to forward www.gamingexodus.com to gamingexodus.com.
-
@julian said in in 1.5.0 entering www. gives error "Looks like your connection to [sitename] was lost, please wait while we try to reconnect.":
"socket.io": {
"origins": "http://domain.tld http://www.domain.tld:*"
}
...If I do this, I get this when I start up NodeBB
/root/nodebb/node_modules/nconf/lib/nconf/stores/file.js:160 throw new Error("Error parsing your configuration file: [" + this.file + ']: ' + ex.message); ^ Error: Error parsing your configuration file: [/root/nodebb/config.json]: Unexpected string at File.loadSync (/root/nodebb/node_modules/nconf/lib/nconf/stores/file.js:160:11) at Provider.add (/root/nodebb/node_modules/nconf/lib/nconf/provider.js:137:23) at Provider.file (/root/nodebb/node_modules/nconf/lib/nconf/provider.js:63:15) at Object.<anonymous> (/root/nodebb/loader.js:14:20) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) at startup (node.js:139:18)
-
I did make the file this
{ "url": "http://keen.wtf", "secret": "2f00fc31-fcaf-473b-bc14-1192d075e68a", "database": "mongo", "port": 80, "mongo": { "host": "127.0.0.1", "port": "27017", "username": "nodebb", "database": "nodebb" "socket.io": { "origins": "http://keen.wtf.tld:* http://www.keen.wtf.tld:*" } } }
-
@pichalite said in in 1.5.0 entering www. gives error "Looks like your connection to [sitename] was lost, please wait while we try to reconnect.":
@MJ remove the
.tld
.wtf
is yourtld
Done this after
./nodebb start
or./nodebb build
i get this
Starting NodeBB
"./nodebb stop" to stop the NodeBB server
"./nodebb log" to view server output
"./nodebb restart" to restart NodeBB/root/nodebb/node_modules/nconf/lib/nconf/stores/file.js:160
throw new Error("Error parsing your configuration file: [" + this.file + ']: ' + ex.message);
^Error: Error parsing your configuration file: [/root/nodebb/config.json]: Unexpected string
at File.loadSync (/root/nodebb/node_modules/nconf/lib/nconf/stores/file.js:160:11)
at Provider.add (/root/nodebb/node_modules/nconf/lib/nconf/provider.js:137:23)
at Provider.file (/root/nodebb/node_modules/nconf/lib/nconf/provider.js:63:15)
at Object.<anonymous> (/root/nodebb/loader.js:14:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18) -
@teh_g I have this
{ "url": "http://keen.wtf", "secret": "2f00fc31-fcaf-473b-bc14-1192d075e68a", "database": "mongo", "port": 80, "mongo": { "host": "127.0.0.1", "port": "27017", "username": "nodebb", "database": "nodebb" "socket.io": { "origins": "http://keen.wtf:* http://www.keen.wtf:*" } } }
-
@MJ you're missing a closing bracket for the mongo block
-
@PitaJ like this?
{ "url": "http://keen.wtf", "secret": "2f00fc31-fcaf-473b-bc14-1192d075e68a", "database": "mongo", "port": 80, "mongo": { "host": "127.0.0.1", "port": "27017", "username": "nodebb", "database": "nodebb" } "socket.io": { "origins": "http://keen.wtf:* http://www.keen.wtf:*" } }
-
it gives same error
/root/nodebb/node_modules/nconf/lib/nconf/stores/file.js:160 throw new Error("Error parsing your configuration file: [" + this.file + ']: ' + ex.message); ^ Error: Error parsing your configuration file: [/root/nodebb/config.json]: Unexpected string at File.loadSync (/root/nodebb/node_modules/nconf/lib/nconf/stores/file.js:160:11) at Provider.add (/root/nodebb/node_modules/nconf/lib/nconf/provider.js:137:23) at Provider.file (/root/nodebb/node_modules/nconf/lib/nconf/provider.js:63:15) at Object.<anonymous> (/root/nodebb/loader.js:14:20) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) at startup (node.js:139:18)
-
@MJ and you need a comma after the bracket. There are many many JSON validators and editors available through the internet. Use them, they'll make things easier.
-
@PitaJ said in in 1.5.0 entering www. gives error "Looks like your connection to [sitename] was lost, please wait while we try to reconnect.":
@MJ and you need a comma after the bracket. There are many many JSON validators and editors available through the internet. Use them, they'll make things easier.
I searched for It and I found one thank you sir