New Install, CentOS and Nginx
-
Hi everyone...I am really new to nodebb and nginx in general. I have a general high level understanding of CentOS and apache so I figured it wouldn't be too hard to figure these things out. At one point, I had the forums working (when you put port 4567 on the end of the URL) but then I started making more changes and now I can't get anything to come up. I've followed a slew of guides to configure nginx and nodebb to allow my forums to show up by using just the URL and they don't seem to do anything...any thoughts you guys have would be very much appreciated.
For your info - CentOS 6.6 (Final), NodeBB v0.5.3-dev (it starts up fine in the logs too), PHP 5.4.34, nginx/1.6.2
Guide I followed - https://blog.tommyparnell.com/installing-nodebb-on-centos-6-5/
I have nginx working great for another domain (just to confirm it wasn't my IP bindings, etc) but that one is just static content.
Is there an error log I could reference within nodebb that I am just missing to see why its not coming up in a browser at all? The output.log seems to never move once it says Ready! at the end.
Thanks in advance!
-
@jimmerz213 Nginx has a log that you should be able to read to see if there's any errors with that. Ubuntu has this in
/var/log/nginx/nginx_error.log
. I'm not sure if CentOS does it any differently, but if when you restart the nginx service, you get a Fail warning, the error is usually output there.I'm assuming you set
use port
tofalse
in your config.json file in the NodeBB folder?Might be worth removing the nginx config file you created and setting up a new one, you can use the guide in the NodeBB Docs to work out what you need.
Could you paste your config.json file with the secret key and any private info removed, you can redact the IP for X's if you want.
Can you also paste the contents of your NodeBB portion of you nginx config, again, you can redact any IPs etc.
-
Is the response blank, or are you getting a gateway error or?
-
Sure - here are the contents of those:
config.json
{
"base_url": "http://forum.myurl.com",
"port": "4567",
"secret": "*****",
"bind_address": "0.0.0.0",
"database": "redis",
"redis": {
"host": "127.0.0.1",
"port": "6379",
"password": "redisPW",
"database": "0"
},
"bcrypt_rounds": 12,
"upload_path": "/public/uploads",
"use_port": false,
"relative_path": ""
}nginx config
server {
listen 10.100.10.20:80;server_name forum.myurl.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 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"; }
}
The log files are there but they are empty. I can't even bring it up on the port number with nginx on/off. When it did work before, I had an apache vhost configured for it on port 80 but even that wasn't working anymore. I have tried removing and re-downloading nodebb a few times, tried a slew of different configurations. Maybe I need to change my redis db? I have always been using 0. It was working at one point (on the port) and some people set some stuff up, I wonder if that's interfering?
As far as what its doing now, it doesn't even connect - it just times out.
-
@jimmerz213 said:
<stuff>So I just built a quick VM locally and followed the guides I mentioned above. Did nothing differently except I didn't install php and apache before and start ripping things out. It works flawlessly. I can only imagine at this point its something with my server and I think I may just wipe it and start clean, using nginx only instead of apache.
Thanks for looking at this stuff guys - I appreciate it.
Edit - welp, it works great now. Probably has this whole time. The URL I was using to hit the forums was set to be x.x.132.x, it had to be x.x.135.x. Hey, at least I learned a TON about nodebb and nginx I'll take it.