# Rocket chat not working on nginx or even with apache2

**URL:** <https://forums.rocket.chat/t/rocket-chat-not-working-on-nginx-or-even-with-apache2/18680>\
**Category:** Community Support\
**Tags:** rocketchat-apps, manual-installation\
**Created:** [November 27, 2023, 7:59am UTC](https://forums.rocket.chat/t/rocket-chat-not-working-on-nginx-or-even-with-apache2/18680 "2023-11-27T07:59:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![udraz](https://avatars.discourse-cdn.com/v4/letter/u/a9a28c/32.png) [@udraz](https://forums.rocket.chat/u/udraz)\
**Post date:** [November 27, 2023, 7:59am UTC](https://forums.rocket.chat/t/rocket-chat-not-working-on-nginx-or-even-with-apache2/18680/1 "2023-11-27T07:59:16Z")

</div>

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](http://localhost:3000/ __meteor__ /dynamic-import/fetch) net::ERR\_CONNECTION\_REFUSED

Here is my rocketchat.service content

```auto
[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

```auto
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

---

<div class="post-metadata">

**Author:** ![Gorfo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Gorfo](https://forums.rocket.chat/u/Gorfo)\
**Post date:** [November 30, 2023, 10:47pm UTC](https://forums.rocket.chat/t/rocket-chat-not-working-on-nginx-or-even-with-apache2/18680/2 "2023-11-30T22:47:23Z")

</div>

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 ?
