@PitaJ said in Can't get Nginx to work:
The URL in your browser bar and the url
value in config.json must match exactly to fix that issue.
So it should work if you leave out the port and use https://your.lan.ip
in config.json
See the following topic for more info:
This FAQ is applicable for the following situations: You're receiving the following error in the Javascript console: WebSocket connection to 'wss:///socket...
NodeBB Community (community.nodebb.org)
I just tried that without success (yes, I made sure to restart NodeBB). Also, the developer mode doesn't fix the problem (contrary to what's stated in the linked thread).
I'm not sure if this has anything to do with the issue, but I had a few errors while setting up NodeBB initially, which I had to address.
npm ERR! path /home/benedikt/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/home/benedikt/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e'
npm ERR! { [Error: EACCES: permission denied, open '/home/benedikt/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, open '/home/benedikt/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path:
npm ERR! '/home/benedikt/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e' },
npm ERR! isOperational: true,
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, open \'/home/benedikt/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path:
npm ERR! '/home/benedikt/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/benedikt/.npm/_logs/2019-03-26T11_23_28_953Z-debug.log
This fixed the error:
benedikt@ubuntu:/var/www/nodebb/NodeBB$ sudo npm install -g --unsafe-perm=true --allow-root
+ [email protected]
added 1 package in 3.912s
benedikt@ubuntu:/var/www/nodebb/NodeBB$ ./nodebb setup
2019-03-26T11:25:02.767Z [19309] - info: NodeBB Setup Triggered via Command Line
Welcome to NodeBB v1.11.2!
Another issue that came up a few times during the installation was that benchpress was missing.
benedikt@ubuntu:/var/www/nodebb/NodeBB$ ./nodebb setup
2019-03-26T11:16:57.048Z [undefined/19138] - error: uncaughtException: Cannot find module 'benchpressjs'
Error: Cannot find module 'benchpressjs'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/var/www/nodebb/NodeBB/install/web.js:13:18)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3) {"error":{"code":"MODULE_NOT_FOUND"},"stack":"Error: Cannot find module 'benchpressjs'\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)\n at Function.Module._load (internal/modules/cjs/loader.js:508:25)\n at Module.require (internal/modules/cjs/loader.js:637:17)\n at require (internal/modules/cjs/helpers.js:22:18)\n at Object.<anonymous> (/var/www/nodebb/NodeBB/install/web.js:13:18)\n at Module._compile (internal/modules/cjs/loader.js:701:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)\n at Module.load (internal/modules/cjs/loader.js:600:32)\n at tryModuleLoad (internal/modules/cjs/loader.js:539:12)\n at Function.Module._load (internal/modules/cjs/loader.js:531:3)","exception":true,"date":"Tue Mar 26 2019 12:16:57 GMT+0100 (Central European Standard Time)","process":{"pid":19138,"uid":1000,"gid":1000,"cwd":"/var/www/nodebb/NodeBB","execPath":"/usr/bin/node","version":"v10.15.3","argv":["/usr/bin/node","/var/www/nodebb/NodeBB/nodebb","setup"],"memoryUsage":{"rss":57671680,"heapTotal":37748736,"heapUsed":21650432,"external":887293}},"os":{"loadavg":[0.33642578125,0.35888671875,0.2109375],"uptime":6022},"trace":[{"column":15,"file":"internal/modules/cjs/loader.js","function":"Module._resolveFilename","line":582,"method":"_resolveFilename","native":false},{"column":25,"file":"internal/modules/cjs/loader.js","function":"Module._load","line":508,"method":"_load","native":false},{"column":17,"file":"internal/modules/cjs/loader.js","function":"Module.require","line":637,"method":"require","native":false},{"column":18,"file":"internal/modules/cjs/helpers.js","function":"require","line":22,"method":null,"native":false},{"column":18,"file":"/var/www/nodebb/NodeBB/install/web.js","function":null,"line":13,"method":null,"native":false},{"column":30,"file":"internal/modules/cjs/loader.js","function":"Module._compile","line":701,"method":"_compile","native":false},{"column":10,"file":"internal/modules/cjs/loader.js","function":"Module._extensions..js","line":712,"method":".js","native":false},{"column":32,"file":"internal/modules/cjs/loader.js","function":"Module.load","line":600,"method":"load","native":false},{"column":12,"file":"internal/modules/cjs/loader.js","function":"tryModuleLoad","line":539,"method":null,"native":false},{"column":3,"file":"internal/modules/cjs/loader.js","function":"Module._load","line":531,"method":"_load","native":false}]}
benedikt@ubuntu:/var/www/nodebb/NodeBB$ sudo npm install
> [email protected] install /var/www/nodebb/NodeBB/node_modules/benchpressjs
> cd rust/benchpress-rs && npm install
> [email protected] install /var/www/nodebb/NodeBB/node_modules/benchpressjs/rust/benchpress-rs
> neon build >> build.log 2>&1 || exit 0
npm notice created a lockfile as package-lock.json. You should commit this file.
added 87 packages from 83 contributors in 4.292s
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā npm update check failed ā
ā Try running with sudo or get access ā
ā to the local update config store via ā
ā sudo chown -R $USER:$(id -gn $USER) /home/benedikt/.config ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
npm notice created a lockfile as package-lock.json. You should commit this file.
added 14 packages from 66 contributors and audited 4333 packages in 15.373s
found 7 vulnerabilities (1 low, 5 moderate, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details
Fix:
benedikt@ubuntu:/var/www/nodebb/NodeBB$ sudo chown -R $USER:$(id -gn $USER) /home/benedikt/.config
Last but not least:
Mar 26 15:36:14 ubuntu system[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Fix:
mkdir /etc/systemd/system/nginx.service.d
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf
systemctl daemon-reload
systemctl restart nginx
I really appreciate your help.