Admin Panel Broken
-
Does anyone have any idea on this? I cannot find any error in log file. all the link become mydomain.com/admin#. User visiting data is not showing. Search tool is not working either.
-
@Kinchtwck have you tried rebuilding and restarting? Reinstalling npm modules? What version etc are you on?
-
Any luck after the rebuild?
-
@PitaJ I did, I tried multiple times, rebuilt and restarted nodebb and Nginx. I even tried to reinstall nodebb and connect to the original database. I wonder if it's the issue with my nginx setting. I am on node -v10.15.3 , npm 6.9
error_log /var/log/nginx/error.log crit; events{ #worker_connections 4000; } http{ server { listen 80; server_name myurl.com; return 302 https://$server_name$request_uri; } server { listen 443; ssl on; ssl_certificate /etc/nginx/ssl/cert_chain.crt; ssl_certificate_key /etc/nginx/ssl/private.key; server_name myurl.com; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } gzip on; gzip_vary on; gzip_min_length 10240; # gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; gzip_disable "MSIE [1-6]\."; } }
Below is the config.json
{ "url": "myurl", "secret": "secret", "database": "mongo", "port": [ "4567", "4568", "4569" ], "mongo": { "host": "127.0.0.1", "port": "27017", "username": "username", "password": "pass", "database": "db", "uri": "" } }
-
@Kinchtwck seems fine, but no socket.io config?
-
-
@scottalanmiller the socket.io config is not necessary. Your recommendation of using
*:*
puts people at risk of cross-site websocket attacks. Nobody should need that configuration option unless they want to use multiple domains with the same NodeBB, in which case they should list the two URLs directly.More information here: https://community.nodebb.org/topic/13388/faq-websockets-not-working-due-to-misconfigured-origins
-
@scottalanmiller the nodebb is running on 8080. For reason I don' know, the nodebb always runs on port 8080 despite the setting in config.json.
-
Here's the example config from our docs:
server { listen 80; server_name forum.example.org; 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"; } }
Here's yours:
server { listen 443; ssl on; ssl_certificate /etc/nginx/ssl/cert_chain.crt; ssl_certificate_key /etc/nginx/ssl/private.key; server_name myurl.com; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } gzip on; gzip_vary on; gzip_min_length 10240; # gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; gzip_disable "MSIE [1-6]\."; }
Firs of all, I'd try to get your forum working with the minimum amount of stuff. Try disabling SSL and gzip and all of the other extraneous stuff there, and ensure that all of the proxy operations are typed correctly and in the same order as the example config.
Please also share any errors you encounter client-side or server-side when running or building nodebb. Remove the port section from your config.json since you obviously aren't using it.
Make sure you are neither installing nor running nodebb with root privileges.
-
@PitaJ The problem is that I am not able to view the site since Google prohibits user visiting site without https. Thanks for the suggestion, I'll delete the gzip and see how it goes. What makes it harder to debug is that the log doesn't show up any error.
-
@Kinchtwck Google absolutely does not do that, what are you talking about? Try a different browser or something.
-
@Kinchtwck said in Admin Panel Broken:
@scottalanmiller the nodebb is running on 8080. For reason I don' know, the nodebb always runs on port 8080 despite the setting in config.json.
If you are still working on getting NodeBB to run on the correct port as specified by the config file, why do you have the file set to three ports? Start with just getting one working, as only one is working anyway.
-
@julian said in Admin Panel Broken:
That's a little odd, it doesn't sound like you're running a regular VPS then, if you can't control the port? What service are you using?
VPS by definition couldn't cause that problem. A VPS you'd always be able to control the port.
-
@Kinchtwck said in Admin Panel Broken:
What makes it harder to debug is that the log doesn't show up any error.
What does netstat -tulpn tell us when you clean up the ports list and restart NodeBB?
-
@scottalanmiller Yes indeed, that's why I said it doesn't sound like it was a VPS
Sadly we're fairly limited in terms of AWS experience, so I can't really help there...
-
@julian said in Admin Panel Broken:
Sadly we're fairly limited in terms of AWS experience, so I can't really help there...
Nothing to know there. AWS is "just a server" like any other. That AWS does the hosting doesn't change things at the OS level. It's the same as a physical server.
-
@scottalanmiller So previously, before updating, I ran the nodebb on 4567, 4568,4569 and pass the 443 proxy to these 3 with Nginx. Now, despite the config.json, I have to forward to 8080 which is the port that the NodeBB is on. I might try to initiate another AWS instance with the same setting to see how it goes.
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3215/nginx tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 2944/node tcp 0 0 127.0.0.1:21 0.0.0.0:* LISTEN 608/vsftpd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 928/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1111/sendmail: MTA: tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3215/nginx tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 1294/mongod tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 1111/sendmail: MTA: tcp6 0 0 :::22 :::* LISTEN 928/sshd tcp6 0 0 :::9000 :::* LISTEN 1049/hhvm udp 0 0 0.0.0.0:42932 0.0.0.0:* 544/dhclient udp 0 0 0.0.0.0:68 0.0.0.0:* 544/dhclient udp6 0 0 :::59961 :::* 544/dhclient