Rocket chat not working on nginx or even with apache2

Hi I am running latest roackchat on ubuntu 22, I am using nginx front ot rockchat

Now when I tried to access then I am getting this in my browser’s console.log

POST http://localhost:3000/__meteor__/dynamic-import/fetch net::ERR_CONNECTION_REFUSED

Here is my rocketchat.service content

[Unit]
Description=The Rocket.Chat server
After=network.target remote-fs.target nss-lookup.target nginx.service mongod.service
[Service]
ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocketchat
Environment=NODE_ENV=production
Environment=ROOT_URL=https://www.myrocetchat.chat
Environment=PORT=3000
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01
Environment=MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01
[Install]
WantedBy=multi-user.target

And here is the nginx configuration

server {

  listen 443 ssl;
  server_name www.myrocetchat.chat;
  ssl_certificate      /root/.acme.sh/myrocetchat.chat_ecc/fullchain.cer;
  ssl_certificate_key  /root/.acme.sh/myrocetchat.chat_ecc/myrocetchat.chat.key;
  ssl_session_cache  builtin:1000  shared:SSL:10m;
  ssl_protocols TLSv1.2 TLSv1.3;
  ssl_ciphers HIGH:!aNULL:!MD5;
  ssl_prefer_server_ciphers on;

location ~ ^/.* {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_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-Proto https;
        proxy_set_header X-Nginx-Proxy true;

        proxy_redirect off;
    }


}

Would you please help me how to solve this issue, even I had tried apache2 as well and the issue was the same

1 Like

Hi
I have the exact same problem with an apache2 proxy.
I read on some Meteor forum that being able to configure the useLocationOrigin attribute of the dynamic-import module could help. But I don’t know how to do it.

Any help there ?