Getting 502 Bad Gateway
-
A new installation fron a few days ago - I restarted the server and I get an error 502
I would very much appreciated your help to understand what's wrong hereThanks you
On systemctl status nginx.service & systemctl status nodebb.service
May 26 00:47:02 test.wewp.net systemd[1]: Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory May 26 00:15:32 test.wewp.net systemd[1]: Can't open PID file /var/www/nodebb/pidfile (yet?) after start: No such file or directory
- log
NodeBB v1.10.2 Copyright (C) 2013-2014 NodeBB Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. For the full license, please visit: http://www.gnu.org/copyleft/gpl.html Clustering enabled: Spinning up 1 process(es). 2020-05-25T21:13:23.104Z [1294] - [32minfo[39m: Initializing NodeBB v1.10.2 https://test.wewp.net [benchpressjs] Unable to build or find a suitable native module, falling back to JS version 2020-05-25T21:13:28.576Z [1294] - [32minfo[39m: [socket.io] Restricting access to origin: https://test.wewp.net:* Mon, 25 May 2020 21:13:28 GMT hsts deprecated The "includeSubdomains" parameter is deprecated. Use "includeSubDomains" (with a capital D) instead. at node_modules/helmet/index.js:33:28 Mon, 25 May 2020 21:13:28 GMT hsts deprecated The "setIf" parameter is deprecated. Refer to the documentation to see how to set the header conditionally. at node_modules/helmet/index.js:33:28 2020-05-25T21:13:29.430Z [1294] - [32minfo[39m: Routes added 2020-05-25T21:13:29.438Z [1294] - [32minfo[39m: NodeBB Ready 2020-05-25T21:13:29.450Z [1294] - [32minfo[39m: Enabling 'trust proxy' 2020-05-25T21:13:29.459Z [1294] - [32minfo[39m: NodeBB is now listening on: 0.0.0.0:4567 2020-05-25T21:15:31.908Z [1294] - [32minfo[39m: [app] Shutdown (SIGTERM/SIGINT) Initialised. 2020-05-25T21:15:31.909Z [1294] - [32minfo[39m: [app] Web server closed to connections. 2020-05-25T21:15:31.913Z [1294] - [32minfo[39m: [app] Database connection closed. 2020-05-25T21:15:31.913Z [1294] - [32minfo[39m: [app] Shutdown complete.
- nodebb config file
{ "url": "https://test.wewp.net", "secret": "PASSWORD", "database": "mongo", "port": "4567", "mongo": { "host": "127.0.0.1", "port": "27017", "username": "nodebb", "password": "PASSWORD", "database": "nodebb" } }
- nginx conf
nginx conf server { listen [::]:443 ssl http2; listen 443 ssl http2; listen [::]:80; listen 80; server_name test.wewp.net; client_max_body_size 50M; # RSA ssl_certificate /etc/letsencrypt/test.wewp.net/fullchain.cer; ssl_certificate_key /etc/letsencrypt/test.wewp.net/test.wewp.net.key; # ECDSA ssl_certificate /etc/letsencrypt/test.wewp.net_ecc/fullchain.cer; ssl_certificate_key /etc/letsencrypt/test.wewp.net_ecc/test.wewp.net.key; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://127.0.0.1:4567; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
-
@shlomi said in Getting 502 Bad Gateway:
A new installation fron a few days ago - I restarted the server and I get an error 502
I would very much appreciated your help to understand what's wrong hereThanks you
On systemctl status nginx.service & systemctl status nodebb.service
May 26 00:47:02 test.wewp.net systemd[1]: Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory May 26 00:15:32 test.wewp.net systemd[1]: Can't open PID file /var/www/nodebb/pidfile (yet?) after start: No such file or directory
Why not? I've not scrutinized the rest of your stuff but a couple quick questions:
-
What is the value of "User" in your nodebb.service? Does it match your nodebb user?
-
What is the value of "PIDFile" in your nodebb.service config?
-
What are the permissions for that directory and file?
-
What is the ownership for that directory and file?
-