Hello,
So I'm on a fresh NodeBB install. DigitalOcean Droplet and I have configured Nginx as proxy server. Like several others, I'm receiving the above stated error as soon as I visit the board. I am no longer able to write anything to the boards basically but they do sorta half-work in that I can navigate and read stuff. I cannot save any settings or create new threads.
This is what I got:
Nginx Config:
# Default server configuration
#
server {
listen 80;
#listen 443;
#listen [::]:80;
server_name myforums.com www.myforums.com;
return 301 https://myforums.com$request_uri; #NOTE: Also tried #scheme and other variants
}
server {
# SSL configuration
#
listen 443 ssl;
server_name myforums.com www.myforums.com;
# listen [::]:443 ssl default_server;
include snippets/letsencrypt.conf;
include snippets/ssl.conf;
root /var/www/nodebb/myforums;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
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 http://127.0.0.1:4567 https://myforums.com;
# Socket.IO Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
My config.json:
{
"url": "https://myforums.com",
"secret": "somesecret",
"bindaddress": "localhost",
"database": "mongo",
"port": 4567,
"use_port":false,
"mongo": {
"host": "127.0.0.1",
"port": "27017",
"username": "myforums",
"password": "somepass123",
"database": "forumsdb"
}
}
I have 2 problems:
-
No matter if I type in https://myforums.com or http://myforums.com , it redirects the user to https://www.myforums.com . I do not want the www.
-
The error message in the subject is happening when I go to my boards. I saw a StackOverflow response where the guy said to add listen port 443 to the first server block but for me, that makes the entire site go down completely.
I'm not sure what needs to be fixed here but something screwy is going on between my SSL, Nginx config, and NodeBB config. Thanks for any assistance. What I'm trying to accomplish here is have a HTTPS-ALWAYS NodeBB. Everything should be https. I dont care about www.