# Nextcloud Office/Built in CODE Server will not load files

**URL:** <https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724>\
**Category:** ℹ️ Support\
**Tags:** reverseproxy, wopi, collabora-online, apache, nextcloud-office\
**Created:** [August 7, 2023, 2:39pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724 "2023-08-07T14:39:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 7, 2023, 2:39pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/1 "2023-08-07T14:39:23Z")

</div>

NC 27.01  
Php 8.12  
PostgreSQL 14.8  
Running behind HaProxy on PfSense with SSL offloading (working)  
CODE Server 23.5.202  
Nextcloud Office 8.10

Nextcloud office with built-in CODE Server fails to open Office and LibreOffice docs  
Gives a ‘Document Loading failed Failed to load Nextcloud Office’ error

Built in CODE Server is reported as reachable, green dot.

However logs has following error:  
[richdocuments] Error: GuzzleHttp\Exception\ClientException: Client error: `GET http://xxx.xxx.net/apps/richdocumentscode/proxy.php?req=/hosting/capabilities` resulted in a `404 Not Found` response:

404 Not Found
#### 404 Not Found
File not found.
* * *
\<ADD (truncated...) at \<\>
1. /var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 69  
GuzzleHttp\Exception\RequestException::create(“\*\*\* sensitive parameters replaced \*\*\*”)
2. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 204  
GuzzleHttp\Middleware::GuzzleHttp{closure}(“\*\*\* sensitive parameters replaced \*\*\*”)
3. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 153  
GuzzleHttp\Promise\Promise::callHandler()
4. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 48  
GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}(“\*\*\* sensitive parameters replaced \*\*\*”)
5. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 248  
GuzzleHttp\Promise\TaskQueue-\>run()
6. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 224  
GuzzleHttp\Promise\Promise-\>invokeWaitFn()
7. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 269  
GuzzleHttp\Promise\Promise-\>waitIfPending()
8. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 226  
GuzzleHttp\Promise\Promise-\>invokeWaitList()
9. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 62  
GuzzleHttp\Promise\Promise-\>waitIfPending()
10. /var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 187  
GuzzleHttp\Promise\Promise-\>wait()
11. /var/www/html/nextcloud/lib/private/Http/Client/Client.php line 226  
GuzzleHttp\Client-\>request()
12. /var/www/html/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php line 135  
OC\Http\Client\Client-\>get()
13. /var/www/html/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php line 73  
OCA\Richdocuments\Service\CapabilitiesService-\>refetch()
14. /var/www/html/nextcloud/apps/richdocuments/lib/AppInfo/Application.php line 85  
OCA\Richdocuments\Service\CapabilitiesService-\>getCapabilities()
15. /var/www/html/nextcloud/lib/private/AppFramework/Bootstrap/FunctionInjector.php line 66  
OCA\Richdocuments\AppInfo\Application-\>OCA\Richdocuments\AppInfo{closure}(“\*\*\* sensitive parameters replaced \*\*\*”)
16. /var/www/html/nextcloud/lib/private/AppFramework/Bootstrap/BootContext.php line 50  
OC\AppFramework\Bootstrap\FunctionInjector-\>injectFn()
17. /var/www/html/nextcloud/apps/richdocuments/lib/AppInfo/Application.php line 140  
OC\AppFramework\Bootstrap\BootContext-\>injectFn()
18. /var/www/html/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php line 200  
OCA\Richdocuments\AppInfo\Application-\>boot()
19. /var/www/html/nextcloud/lib/private/App/AppManager.php line 437  
OC\AppFramework\Bootstrap\Coordinator-\>bootApp()
20. /var/www/html/nextcloud/lib/private/App/AppManager.php line 216  
OC\App\AppManager-\>loadApp()
21. /var/www/html/nextcloud/lib/private/legacy/OC\_App.php line 126  
OC\App\AppManager-\>loadApps()
22. /var/www/html/nextcloud/lib/base.php line 1051  
OC\_App::loadApps()
23. /var/www/html/nextcloud/index.php line 36  
OC::handleRequest()

GET /index.php/apps/files/api/v1/stats  
from 192.168.10.1 by xxxx at 2023-08-07T14:20:29+00:00

Interestingly when setting up the built in server (that shows green dot), the following is displayed briefly:

 ![Screen Shot 2023-08-07 at 9.44.38 AM](https://help.nextcloud.com/uploads/default/original/3X/a/f/af53de62216701deba505648296627c3ad39a163.png)

Which is probably the problem here - but I do not know how to change this on the built in CODE server. Or if that is even doable.

As a note I did have this working behind an NGINX reverse proxy until recent updates to Nextcloud Office and CODE Server broke something. There were no special rules for the CODE Server, just for WellKnownCardDav etc, I decided to switch over to HaProxy to get my reverse proxy located in PfSense and free up a Truenas Jail where the NGINX reverse proxy had been.

I was hoping today’s update of the CODE server might help, but no joy.

Have tried setting WOPI to 0.0.0.0 etc., which doesn’t seem to make a difference.

ATM Nextcloud office is basically unusable for me.

I have researched this problem, but it only seems to be documented and addressed for Collabora CODE Server installs which for me is another rabbit hole, although if I have to I’ll set up a separate server, but I’d much rather use the built-in as I don’t have heavy demands for editing etc., so I can deal with the slowness of the built-in.

I have also tried to figure out if there is a missing HaProxy config given that my NC install is running on Port 80 and HaProxy is handling the SSL with ACME producing the Let’s Encrypt Cert for the site. I have not found any documentation of such.

I am no expert, but would appreciate any input on where to go to fix this. Unless of course the latest versions of these apps broke something that had previously working… I doubt that’s the case, but possible.

Thanks for any input.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 7, 2023, 3:21pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/2 "2023-08-07T15:21:44Z")

</div>

Built-in CODE heavily relies on correct reverse proxy config - likely something is wrong with you overwrite\* parameters (or proxy headers). Especially the error regarding http:// makes me think something is wrong with reverse proxy config.

this might help: [Nextcloud Collabora integration](https://help.nextcloud.com/t/nextcloud-collabora-integration/151879) it’s mainly about dedicated setup but few hints address built-in CODE as well.

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 7, 2023, 3:43pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/3 "2023-08-07T15:43:52Z")

</div>

@wwe Thanks for the comment - I had actually read your wiki before and was able to see that my NC was reaching the richdocuments code hosting proxy, for example. I really appreciate that the wiki is a proper debug checklist.

I tried modifying my apache virtual hosts config, as I had to get caldav and carddav working, but was left scratching my head.

I tried adding a rule in PfSense to allow port 9980-9984 traffic back to my NC install, and tried adding config to HaProxy, but in short dont know enough to know how to do that and havent found a guide anywhere.

In short I dont know what to do to address overwrite parameters, like what that means. Just being honest. So I dont know if that’s a problem with HaProxy, Pfsense or Apache or NC Config.php (I dont think it’s the config.php as the trusted proxy works).

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 7, 2023, 7:31pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/4 "2023-08-07T19:31:33Z")

</div>

nobody can tell you how your system must be setup. again plan http:// is a problem as well - you have to analyze and resolve the problem…

following the guide I provided you will find at least this working Apache config which is easy to adopt for other products

> [@Collabora - Built in Code - Reverse Proxy / "ssl.enable" and "ssl.termination"](https://help.nextcloud.com/t/collabora-built-in-code-reverse-proxy-ssl-enable-and-ssl-termination/161943/5):
>
> Nevermind… i just tested: \<IfModule mod\_ssl.c\> \<VirtualHost \*:443\> ServerName www.(MYDOMAIN) ProxyPreserveHost On DocumentRoot /var/www/html ProxyPass /.well-known ! ProxyPass / http://192.168.2.31:80/ flushpackets=on ProxyPassReverse / http://192.168.2.31:80/ LimitRequestBody 0 RequestHeader set X-Forwarded-SSL "1" RequestHeader set X-Forwarded-Proto "https" env=HTTPS \<IfModule mod\_headers.c\> RewriteEngine On Header always set Strict-Transport-Security "max-age=15768000; pre…

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 8, 2023, 2:07pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/5 "2023-08-08T14:07:38Z")

</div>

@wwe Thanks again.  
Update: I got rid of the guzzle exception error by changing the overwrite.cli.url from http to https in config.php  
However I am still getting a ‘Document Loading failed Failed to load Nextcloud Office’ error and although I appreciated the document you referred me to and tried putting those settings in my Apache Virtual hosts file, it did not change the situation. The problem seems to be how to configure the built in CODE server to have the correct ssl.enable and ssl.termination settings.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 9, 2023, 7:39pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/6 "2023-08-09T19:39:13Z")

</div>

there is nothing to configure builtin CODE. It completely relies on reverse proxy header to understand the config.  
Please follow the discussions I provided.

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 9, 2023, 7:52pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/7 "2023-08-09T19:52:59Z")

</div>

@wwe thanks, did not fully get that.

Where could I find an explanation of what a reverse proxy header is? I think if I understood that I could figure out what to tweak in HaProxy

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 10, 2023, 9:38am UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/8 "2023-08-10T09:38:54Z")

</div>

use your favorite internet search engine and familiarize yourself how applications run behind reverse proxy and how requested URI and scheme are configured. “real ip” is a useful search term.

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 10, 2023, 10:36pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/9 "2023-08-10T22:36:45Z")

</div>

@wwe thanks again. I have spent some time researching how applications run behind reverse proxies.  
What I cant figure out is in this case, where the built in CODE server is trying to talk to the NC instance, that the CODE server is communicating with HTTPS wheras the NC install is HTTP, behind Haproxy which is doing the SSL termination for NC. So the CODE server cant talk to NC.  
So, is this a problem solved in my virtual host, my config.php file for NC or HaProxy setup?

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 11, 2023, 10:14am UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/10 "2023-08-11T10:14:58Z")

</div>

> [@ngreene](#):
>
> NC install is HTTP, behind Haproxy which is doing the SSL termination for NC.

this means your NC is running https:// and CODE is correctly accessing NC with https://.

if the user sits in front of the proxy there is no way CODE can access Nextcloud bypassing the proxy.

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 11, 2023, 12:55pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/11 "2023-08-11T12:55:22Z")

</div>

@wwe You keep replying which I appreciate. Let me rephrase what I’m saying:  
I think it means that NC is http behind the proxy, so if CODE is running https it wont connect - which is the current situation.  
So to get CODE running with the correct ssl.enable and ssl.termination (the error in setup I have) to be able to talk to NC - is that an Apache, Haproxy or NC Config thing? My virtual host in Apache is on port 80, behind the reverse proxy. Hopefully that makes more sense?

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 11, 2023, 8:09pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/12 "2023-08-11T20:09:31Z")

</div>

> [@ngreene](#):
>
> I think it means that NC is http behind the proxy, so if CODE is running https it wont connect - which is the current situation.

I’m sorry I can’t follow your questions. Initially you stated you run built-in CODE server which automatically makes Nextcloud and CODE running same http/s protocol and same hostname. Assuming your NC runs well you likely only need to verify correct reverse proxy headers. If you run another config please do 3 steps back and describe how you setup the system and provide all the logs…

Please take the time to read and understand the integration wiki - I wrote wiki this because WOPI integration is very different from normal webhosting and many many people struggle with the config. I’m confident 99% of all questions are answered already and I’ll be happy to help you with the remaining 1%… or maybe this 1% are real bugs and not generic “it doesn’t work” 😉

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 13, 2023, 9:46pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/13 "2023-08-13T21:46:46Z")

</div>

@wwe ok progress.

```auto
RequestHeader set X-FORWARDED-PROTOCOL https
RequestHeader set X-Forwarded-Ssl on

```

in the Apache2 Virtual Host made it possible to open .ods and word/excel files momentarily.

But then get the document failed to load error again.

```auto
<VirtualHost *:80>
ServerName (server).net
ServerAdmin (server).net
DocumentRoot /var/www/html/nextcloud
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

RequestHeader set X-FORWARDED-PROTOCOL https
RequestHeader set X-Forwarded-Ssl on

Redirect 301 /.well-known/carddav https://(server)/remote.php/dav
Redirect 301 /.well-known/caldav https://(server)/remote.php/dav
Redirect 301 /.well-known/webfinger https://(server)t/index.php/.well-known/webfinger
Redirect 301 /.well-known/nodeinfo https://(server)/index.php/.well-known/nodeinfo
</VirtualHost>

```

I also had to set WOPI allow to 0.0.0.0/0  
And remove reinstall CODE and Nextcloud office.

Persistence pays off. Thanks for nudging me along.

This the error in the log when it stopped working again. If I flush the cache on my browser it works again for a moment.

No longer getting errors in the Code Server setup.

This is the log for the error thrown:

```auto
[richdocuments] Info: GuzzleHttp\Exception\ServerException: Server error: `POST https://xxx.xxxx.net/apps/richdocumentscode/proxy.php?req=/lool/convert-to/png` resulted in a `502 Bad Gateway` response:
<html><body><h1>502 Bad Gateway</h1>
The server returned an invalid or incomplete response.
</body></html>

 at <<closure>>

 0. /var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 69
    GuzzleHttp\Exception\RequestException::create(" ***sensitive parameters replaced***")
 1. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 204
    GuzzleHttp\Middleware::GuzzleHttp\{closure}(" ***sensitive parameters replaced***")
 2. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 153
    GuzzleHttp\Promise\Promise::callHandler()
 3. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 48
    GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}(" ***sensitive parameters replaced***")
 4. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 248
    GuzzleHttp\Promise\TaskQueue->run()
 5. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 224
    GuzzleHttp\Promise\Promise->invokeWaitFn()
 6. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 269
    GuzzleHttp\Promise\Promise->waitIfPending()
 7. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 226
    GuzzleHttp\Promise\Promise->invokeWaitList()
 8. /var/www/html/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 62
    GuzzleHttp\Promise\Promise->waitIfPending()
 9. /var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Promise\Promise->wait()
10. /var/www/html/nextcloud/lib/private/Http/Client/Client.php line 297
    GuzzleHttp\Client->request()
11. /var/www/html/nextcloud/apps/richdocuments/lib/Preview/Office.php line 90
    OC\Http\Client\Client->post()
12. /var/www/html/nextcloud/lib/private/Preview/ProviderV1Adapter.php line 53
    OCA\Richdocuments\Preview\Office->getThumbnail()
13. /var/www/html/nextcloud/lib/private/Preview/GeneratorHelper.php line 64
    OC\Preview\ProviderV1Adapter->getThumbnail()
14. /var/www/html/nextcloud/lib/private/Preview/Generator.php line 397
    OC\Preview\GeneratorHelper->getThumbnail()
15. /var/www/html/nextcloud/lib/private/Preview/Generator.php line 373
    OC\Preview\Generator->generateProviderPreview()
16. /var/www/html/nextcloud/lib/private/Preview/Generator.php line 166
    OC\Preview\Generator->getMaxPreview()
17. /var/www/html/nextcloud/lib/private/Preview/Generator.php line 116
    OC\Preview\Generator->generatePreviews()
18. /var/www/html/nextcloud/lib/private/PreviewManager.php line 192
    OC\Preview\Generator->getPreview()
19. /var/www/html/nextcloud/core/Controller/PreviewController.php line 144
    OC\PreviewManager->getPreview()
20. /var/www/html/nextcloud/core/Controller/PreviewController.php line 113
    OC\Core\Controller\PreviewController->fetchPreview()
21. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
    OC\Core\Controller\PreviewController->getPreviewByFileId()
22. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController()
23. /var/www/html/nextcloud/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch()
24. /var/www/html/nextcloud/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main()
25. /var/www/html/nextcloud/lib/base.php line 1071
    OC\Route\Router->match()
26. /var/www/html/nextcloud/index.php line 36
    OC::handleRequest()

GET /index.php/core/preview?fileId=1270797&x=250&y=250
from 192.168.10.1 by xxx at 2023-08-13T22:13:23+00:00

```

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 14, 2023, 6:26am UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/14 "2023-08-14T06:26:29Z")

</div>

> [@ngreene](#):
>
> `POST https://xxx.xxxx.net/apps/richdocumentscode/proxy.php?req=/lool/convert-to/png`

it looks like reverse proxy doesn’t know where to route this request… maybe the reverse proxy config is still incomplete. Looking at [Collabora reverse proxy](https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html) guide I see many special config - not sure this is required for built-in CODE as well… I would start with `proxy_set_header Host $http_host;` I don’t see it in your config…

There was working Apache reverse proxy example [linked to the above guide](https://help.nextcloud.com/t/collabora-built-in-code-reverse-proxy-ssl-enable-and-ssl-termination/161943)… the solution is not very clear but two different working Apache configs

another weird issue there is a **/lool/** piece in the URI while [CODE switched to **/cool/** long time ago](https://help.nextcloud.com/t/important-changes-regarding-cool-code-docker-versions-from-v21-11-3-6-on-multiple-domains-setup/137867)…

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 14, 2023, 2:07pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/15 "2023-08-14T14:07:43Z")

</div>

@wwe

> [@wwe](#):
>
> I would start with `proxy_set_header Host $http_host;` I don’t see it in your config…

That is an NGINX parameter, trying to find equivalent in Apache2

I tried

```auto
sudo killall coolwsd

```

to see if it would address the lool error you mentioned. Reinstalled CODE and Office after.

As it stands I can open docs every 2nd or 3rd try, getting ‘Document Failed to Load’ error in between.

Getting there…

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 14, 2023, 8:05pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/16 "2023-08-14T20:05:33Z")

</div>

> [@ngreene](#):
>
> > [@wwe](#):
> >
> > I would start with `proxy_set_header Host $http_host;` I don’t see it in your config…
> 
> That is an NGINX parameter, trying to find equivalent in Apache2

try **`ProxyPreserveHost On`**

> [@ngreene](#):
>
> As it stands I can open docs every 2nd or 3rd try, getting ‘Document Failed to Load’ error in between.

maybe browser log (f12) gives more insights what is going wrong?

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [August 16, 2023, 1:09pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/17 "2023-08-16T13:09:51Z")

</div>

@wwe thanks.

I did use

```auto
ProxyPreserveHost On

```

And that got me to being able to open every two or three tries

It seems like the proxy parameters need a directive that will enable opening each try, either allowing multiple requests or setting the proxy to handle a new request each time - a subjective take I know, but not sure which other parameter is needed and I’ve scoured through Apache2 documentation, trying to guess basically.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [August 16, 2023, 6:23pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/18 "2023-08-16T18:23:09Z")

</div>

> [@ngreene](#):
>
> got me to being able to open every two or three tries

If you say it works every few times I would try to find a difference - if this is another header, DNS, cache etc… is there some “logic” between working and non-working scenarios, like it works every X seconds or after every Z requests? just wondering - you are not running some weird security solution which limits the number of requests or "sanitize"s URLs?

---

<div class="post-metadata">

**Author:** ![ngreene](https://help.nextcloud.com/letter_avatar/ngreene/32/6_449c533f586939b6e5f246632a46421f.png) [@ngreene](https://help.nextcloud.com/u/ngreene)\
**Post date:** [December 26, 2023, 9:56pm UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/19 "2023-12-26T21:56:43Z")

</div>

Update: Solved this issue - what was causing the problem was two DNS forwarding IP addresses from Route 53, one was incorrect. With this resolved everything else worked flawlessly. Nothing special needed in the Apache config as far as the reverse proxy goes.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [January 16, 2025, 9:07am UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-code-server-will-not-load-files/167724/20 "2025-01-16T09:07:44Z")

</div>


