Which file to edit when getting rid of the 4567 port number?
-
If you are standing NginX up on the box, you have no reason to change the NodeBB port.
You can just have NginX proxy it.
The users will never see the port.
-
Here is all you have to put in your serever config for NginX
Edit: Looking at your screenshots closer, I see this link. So the point you are missing is that nothing here is changing NodeBB. NodeBB always runs on 4567 in this case.
-
I do not edit nginx core conf files, instead I added a conf file in conf.d
This is my proxy setup for my nodeBB instance. My nodeBB is only another VM instead of on the same as NginX, so I have a internal IP listed in there for the redirect instead of 127.0.0.1 loopback.
# /etc/nginx/conf.d/obelisk.daerma.com.conf server { client_max_body_size 40M; listen 443 ssl; server_name obelisk.daerma.com; ssl on; ssl_certificate /etc/letsencrypt/live/daerma.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/daerma.com/privkey.pem; ssl_stapling on; ssl_stapling_verify on; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; 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://10.254.0.106:4567; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { client_max_body_size 40M; listen 80; server_name obelisk.daerma.com; rewrite ^ https://$server_name$request_uri? permanent; }
-
@JaredBusch : even for the links you see, when you click on one, you get 404 error. So they lead to no where really
-
Check if the nginx.conf is actually reading the conf files. Some repos don't include them.
For example, I just installed from the Digital Ocean repo, and it didn't include sites-available or conf.d, I had to add the lines myself. It also had a server block for port 80 that routed everything to a blank page, which I removed.
include /etc/nginx/sites-enabled/*;
I doubt this is your particular problem, but others might find it useful.
-
@yariplus: Right now I can be able to reach Nginx's default page when I type another URL other that containing NodeBB.
My question specifically is where I paste the server block that is on the NodeBB's help page. I had opened my file in the sites-available directory and then added it in the server block. Is this what you did too?
-
@Zig.gy Yes.
I have one file in sites-available,
/etc/nginx/sites-available/yaricraft
and it contains exactly what's in the NodeBB docs. And that file is aliased intosites-enabled
.tbh, it looks like you did everything right with nginx, since it's serving the correct page. Which is why my first guess was your nodebb config.
-
@JaredBusch said:
Here is all you have to put in your serever config for NginX
Edit: Looking at your screenshots closer, I see this link. So the point you are missing is that nothing here is changing NodeBB. NodeBB always runs on 4567 in this case.
I think i have this same problem, how do i make it listen on 80?