# Open files error: "This site can't be reached. Localhost refused to connect."

**URL:** <https://forums.rocket.chat/t/open-files-error-this-site-cant-be-reached-localhost-refused-to-connect/11024>\
**Category:** Community Support\
**Created:** [April 24, 2021, 7:49pm UTC](https://forums.rocket.chat/t/open-files-error-this-site-cant-be-reached-localhost-refused-to-connect/11024 "2021-04-24T19:49:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/alan/32/2739_2.png) [@Alan](https://forums.rocket.chat/u/Alan)\
**Post date:** [April 24, 2021, 7:49pm UTC](https://forums.rocket.chat/t/open-files-error-this-site-cant-be-reached-localhost-refused-to-connect/11024/1 "2021-04-24T19:49:13Z")

</div>

### Description

Rocket.Chat works as expected except for files that I attach in a channel. I can attach a .pdf and everything works as expected. The file name appears as a hyperlink on the post in the channel. But when I click on the link I get an error that I quote in the topic subject above. What am I doing wrong here?

### Server Setup Information

- Version of Rocket.Chat Server: 3.13.2
- Operating System: Ubuntu linux
- Deployment Method: snap
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version:
- MongoDB Version:
- Proxy: 
- Firewalls involved:

### Any additional Information

---

<div class="post-metadata">

**Author:** ![Alan](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/alan/32/2739_2.png) [@Alan](https://forums.rocket.chat/u/Alan)\
**Post date:** [May 2, 2021, 5:19pm UTC](https://forums.rocket.chat/t/open-files-error-this-site-cant-be-reached-localhost-refused-to-connect/11024/2 "2021-05-02T17:19:58Z")

</div>

Bump. Anyone out there?

---

<div class="post-metadata">

**Author:** ![john.crisp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/john.crisp/32/2711_2.png) [@john.crisp](https://forums.rocket.chat/u/john.crisp)\
**Post date:** [May 3, 2021, 11:36am UTC](https://forums.rocket.chat/t/open-files-error-this-site-cant-be-reached-localhost-refused-to-connect/11024/3 "2021-05-03T11:36:01Z")

</div>

Yup.

> Localhost refused to connect.

So how have you got your DNS set up?

Are you using a reverse proxy/SSL etc etc? Sounds like you are accessing it from a different URL than expected?

---

<div class="post-metadata">

**Author:** ![Alan](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/alan/32/2739_2.png) [@Alan](https://forums.rocket.chat/u/Alan)\
**Post date:** [May 3, 2021, 5:04pm UTC](https://forums.rocket.chat/t/open-files-error-this-site-cant-be-reached-localhost-refused-to-connect/11024/4 "2021-05-03T17:04:02Z")

</div>

It is set up on a reserved IP address: 192.168.1.22. Nothing fancy here; just defaults.

- File uploads is enabled.
- Accepted media types is black to accept all.
- Using GridFS for storage type.

And again, the whole install works perfectly except for when I try to access an uploaded file. When accessing a test pdf I just uploaded, the url that fails is:

[http://localhost/file-upload/sH2CZR6aGEJXs8ktK/test.pdf?download](http://localhost/file-upload/sH2CZR6aGEJXs8ktK/test.pdf?download)

Thanks for any pointers.

---

<div class="post-metadata">

**Author:** ![Alan](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/alan/32/2739_2.png) [@Alan](https://forums.rocket.chat/u/Alan)\
**Post date:** [May 4, 2021, 8:36am UTC](https://forums.rocket.chat/t/open-files-error-this-site-cant-be-reached-localhost-refused-to-connect/11024/5 "2021-05-04T08:36:27Z")

</div>

I solved it: I needed to go into General \> Site URL and change from localhost to the ip address of the install. Works now.
