I created a docker-compose network for NodeBB which consists of Mongo, Nginx and NodeBB images. After I docker-compose up, everything starts up (There is additional issue of installation page looking weirdly and does not work if I use CMD command like "./nodebb start" from the dockerfile, however it works normally if I go to NodeBB image bash and do it manually).
But the problem is different. When I install NodeBB and launch it, it only operates from 0.0.0.0:4567 URL, and not from what I specify as my canonical URL (https://irrisuite.ru or https://forum.irrisuite.ru or anything else). I guess there might be an issue with NGinx upstream/redirecting or something else. Here is my app.conf for NGinx:
server {
listen 80;
server_name irrisuite.ru; location / {
return 301 https://$host$request_uri;
}
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
}
server {
listen 443 ssl;
server_name irrisuite.ru;
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";
}
ssl_certificate /etc/letsencrypt/live/irrisuite.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/irrisuite.ru/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
Here is my docker-compose.yml if needed:
version: '3.1'
services:
mongo:
container_name: container-mongo-club
image: mongo:4.4.14-focal
restart: always
command:
- --auth
ports:
- "27017:27017"
volumes:
- ./mongo-docker/docker-entrypoint-initdb.d/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
- "~/${MONGO_DB_FOLDER:-mongo}/${MONGO_DB_NAME:-nodebb}:/data/db"
irrisclub:
container_name: irrisclub
build: .
ports:
- "4567:4567"
depends_on:
- mongo
links:
- mongo
# stdin_open: true # docker run -i
# tty: true # docker run -t
nginx:
image: nginx:1.15-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
certbot:
image: certbot/certbot
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
Where irrisclub being the nodeBB container. Also here are my NodeBB logs:
2022-10-04T14:47:49.587Z [4567/269] - warn: [helpers.setupAdminPageRoute(/admin/plugins/mentions)] passing `middleware` as the third param is deprecated, it can now be safely removed
2022-10-04T14:47:49.599Z [4567/269] - warn: [helpers.setupAdminPageRoute(/admin/plugins/emoji)] passing `middleware` as the third param is deprecated, it can now be safely removed
2022-10-04T14:47:49.640Z [4567/269] - info: [api] Adding 0 route(s) to `api/v3/plugins`
2022-10-04T14:47:49.651Z [4567/269] - info: [router] Routes added
2022-10-04T14:47:49.653Z [4567/269] - info: 🎉 NodeBB Ready
2022-10-04T14:47:49.654Z [4567/269] - info: 🤝 Enabling 'trust proxy'
2022-10-04T14:47:49.656Z [4567/269] - info: 📡 NodeBB is now listening on: 0.0.0.0:4567
2022-10-04T14:47:49.656Z [4567/269] - info: 🔗 Canonical URL: http://forum.irrisuite.ru