Can't access forums from www.website.com
-
Hello,
I recently install nodebb and I setup the config.json and my nginx server so I can access the forums from https://website.com/. In my config.json I added the socket.io property so I can access my forums via https://website.com/ and https://www.website.com/. However, every time I try to access my forums from https://www.website.com it keeps showing the default message to the nginx server setup. Can anyone tell me what I can do to fix this.
Here is my config.json file:
{
"url": "https://website.com/",
"secret": "Number",
"database": "mongo",
"mongo": {
"host": "127.0.0.1",
"port": "port",
"username": "user",
"password": "password",
"database": "database",
"uri": ""
},
"socket.io": {
"origins": "https://www.website.com: * https://website.com:*"
}
}I tried switching the two around in socket.io but nothing worked. Also I have a space between "https://www.website.com:" and "*" because the forum is thinking I am trying to place an emoji in.
Here is my Nginx Server Config:
server {
listen 80;server_name website.com; 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"; }
}
Thanks,
Brian -
The socket.io origins has no effect here. This is totally doable with just nginx: look up how to set up a redirect from
www.domain.com
todomain.com
You want to set up a redirect from http to https anyways.
-
@PitaJ said in Can't access forums from www.website.com:
look up how to set up a redirect from www.domain.com to domain.com
@PitaJ I was able to find an article online and was able to fix the issue. Now when I login and I click the AdminCP, it takes me back to the login screen. I login again and it takes me to the home page of my forums. I try clicking the adminCP button again and it takes me back to the home page.
-
2020-03-04T20:46:08.633Z [4567/22147] - info: [socket.io] Restricting access to origin: https://website.com: *
That's the error I am getting
-
@Brian-Rivera that's not an error, its just info