Nodebb not accessible from LAN
-
I've deployed two nodebb instances. One on default port 4567, the other on 12001.
The first site works well and is accessible from LAN, while the other doesn't. I expect that the problem to be due to the listening port.$ sudo lsof -i :12001 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nodejs 25188 cvda 16u IPv4 1217747 0t0 TCP localhost:12001 (LISTEN) $ sudo lsof -i :4567 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nodejs 27547 cvda 15u IPv4 1241539 0t0 TCP *:4567 (LISTEN)
As you can see, the 12001 is listening to
localhost:12001
while 4567 is listening*:4567
. Maybe this is the problem.Here I paste my config.json.
The
12001
copy{ "base_url": "http://162.105.**.**", "port": "12001", "secret": "byc9989", "bind_address": "0.0.0.0", "database": "redis", "redis": { "host": "127.0.0.1", "port": "6379", "password": "", "database": "1" }, "bcrypt_rounds": 12, "upload_path": "/public/uploads", "use_port": true, "relative_path": "" }
The
4567
copy{ "base_url": "http://162.105.**.**", "port": "4567", "secret": "byc9989", "bind_address": "0.0.0.0", "database": "redis", "redis": { "host": "127.0.0.1", "port": "6379", "password": "", "database": "0" }, "bcrypt_rounds": 12, "upload_path": "/public/uploads", "use_port": true, "relative_path": "" }
As you can see, the visible part is almost the same. I'm much confused on this. Please get me some hints. Thanks.
(Sorry I have to black out my IP)
-
If you're trying to access it from LAN with the global (router) IP you may get in trouble if the port isn't open within router config or gets catches from any other firewall.
-
If you're trying to access it from LAN with the global (router) IP you may get in trouble if the port isn't open within router config or gets catches from any other firewall.
@frissdiegurke I don't think the problem is with the router since the process is actually listening to
localhost:12001
instead of
*:12001
.
Am I right on this? -
@Chong Not sure if this i related to NodeBB, but it does look like the 12001 NodeBB is bound only to the localhost interface...
-
@julian Right. That's also my guess. The problem is the same config.json resulted in different server behavior. Any suggestion that I can make nodebb listen to
*:12001
?
Thx.