OK.
@phenomlab
I resume in details.
1- Stop nodebb
2- Stop iframely
3- Stop nginx
4- Install redis server : sudo apt install redis-server
5- Change nodebb Config.json file (can you verifiy this synthax please ? nodebb documentation tell “database”: 0 and not “database”: 5 - but maybe it’s just a name and i can use the same as mongo like “database”: nodebb , I moved the port directive) :
{
"url": "https://XX-XX.net",
"secret": "XXXXXXXXXXXXXXXX",
"database": "mongo",
"port": [4567, 4568,4569],
"mongo": {
"host": "127.0.0.1",
"port": "27017",
"username": "XXXXXXXXXXX",
"password": "XXXXXXXXXXX",
"database": "nodebb",
"uri": ""
},
"redis": {
"host":"127.0.0.1",
"port":"6379",
"database": 5
}
}
6- Change nginx.conf :
# add the below block for nodeBB clustering
upstream io_nodes {
ip_hash;
server 127.0.0.1:4567;
server 127.0.0.1:4568;
server 127.0.0.1:4569;
}
server {
server_name XX-XX.net www.XX-XX.net;
listen XX.XX.XX.X;
listen [XX:XX:XX:XX::];
root /home/XX-XX/nodebb;
index index.php index.htm index.html;
access_log /var/log/virtualmin/XX-XX.net_access_log;
error_log /var/log/virtualmin/XX-XX.net_error_log;
# add the below block which will force all traffic into the cluster when referenced with @nodebb
location @nodebb {
proxy_pass http://io_nodes;
}
location / {
limit_req zone=flood burst=100 nodelay;
limit_conn ddos 10;
proxy_read_timeout 180;
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;
# It's necessary to set @nodebb here so that the clustering works
proxy_pass @nodebb;
proxy_redirect off;
# Socket.IO Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
listen XX.XX.XX.XX:XXssl http2;
listen [XX:XX:XX:XX::]:443 ssl http2;
ssl_certificate /etc/ssl/virtualmin/166195366750642/ssl.cert;
ssl_certificate_key /etc/ssl/virtualmin/166195366750642/ssl.key;
if ($scheme = http) {
rewrite ^/(?!.well-known)(.*) "https://XX-XX.net/$1" break;
}
}
7- restart redis server systemctl restart redis-server.service
8- Restart nginx
9- Restart iframely
10- Restart nodebb
11- test configuration