Text Files Outside Network

Text files (.txt and .md) will not open in the iPhone app from outside of my LAN. The only meaningful differences that I can think of are NAT on pfsense (all traffic on 443 is forward to nginx) and network speed 200M / 20M (which should be more than enough to open a text file). Additional details can be found below.

LAN Path
client → nginx → apache → nextcloud

WAN Path
pfsense → nginx → apache → nextcloud

Nextcloud version 25.0.3
Operating system and version FreeBSD 13.1 Release p2
nginx version 1.22.1
apache 2.4.54
PHP version 8.1.14

pfsense forwarding all traffic on 443 to nginx
nginx proxying traffic to nextcloud
apache serves nextcloud on port 80

config.php

<?php
$CONFIG = array (
  'instanceid' => '????',
  'passwordsalt' => '???',
  'secret' => '?????',
  'trusted_domains' =>
  array (
    0 => 'MY_HOST',
  ),
  'trusted_proxies' =>
  array (
    0 => '192.168.10.10',
  ),
  'overwriteprotocol' => 'https',
  'datadirectory' => '/usr/local/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '25.0.3.2',
  'overwrite.cli.url' => 'https://MY_HOST',
  'dbname' => 'office',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'BOB',
  'dbpassword' => '??????   ',
  'installed' => true,
  'theme' => '',
  'loglevel' => 2,
  'preview_ffmpeg_path' => '/usr/local/bin/ffmpeg',
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\BMP',
    1 => 'OC\\Preview\\GIF',
    2 => 'OC\\Preview\\HEIC',
    3 => 'OC\\Preview\\JPEG',
    4 => 'OC\\Preview\\MarkDown',
    5 => 'OC\\Preview\\Movie',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\OpenDocument',
    8 => 'OC\\Preview\\PDF',
    9 => 'OC\\Preview\\PNG',
    10 => 'OC\\Preview\\SVG',
    11 => 'OC\\Preview\\TIFF',
    12 => 'OC\\Preview\\TXT',
    13 => 'OC\\Preview\\Krita',
    14 => 'OC\\Preview\\XBitmap',
  ),
  'maintenance' => false,
  'mail_from_address' => 'admin',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'MY_DOMAIN',
  'mail_smtphost' => 'localhost',
);

apache logs

192.168.10.10 - USERNAME [23/Jan/2023:19:03:52 -0800] "POST /ocs/v2.php/apps/files/api/v1/directEditing/open?path=/kiziah-nava/grocery-list.md&editorId=text HTTP/1.0" 200 200
192.168.10.10 - - [23/Jan/2023:19:03:52 -0800] "POST /index.php/apps/text/session/sync HTTP/1.0" 200 246
192.168.10.10 - - [23/Jan/2023:19:03:52 -0800] "GET /index.php/apps/files/directEditing/DjygWdGgeWdbBwkmsJJFCf5JXdJ7DKknYMcqFYGXRLJPJ5HoWoBfry26JRXKMLbo HTTP/1.0" 200 4684
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /core/css/server.css?v=bfb7b0cc-0 HTTP/1.0" 200 162364
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /dist/core-files_fileinfo.js?v=bfb7b0cc-0 HTTP/1.0" 200 928
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /dist/core-files_client.js?v=bfb7b0cc-0 HTTP/1.0" 200 12462
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /dist/core-main.js?v=bfb7b0cc-0 HTTP/1.0" 200 148452
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /apps/theming/css/default.css?v=47354877-0 HTTP/1.0" 200 3251
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /dist/core-common.js?v=bfb7b0cc-0 HTTP/1.0" 200 14249367
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /index.php/core/js/oc.js?v=bfb7b0cc HTTP/1.0" 200 3685
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /index.php/js/core/merged-template-prepend.js?v=bfb7b0cc-0 HTTP/1.0" 200 3098
192.168.10.10 - - [23/Jan/2023:19:03:53 -0800] "GET /dist/files_sharing-main.js?v=bfb7b0cc-0 HTTP/1.0" 200 371

nginx configuration

server {
    listen 443 ssl;
    server_name my_domain;

    ssl_certificate /usr/local/etc/nginx/fullchain.pem;
    ssl_certificate_key /usr/local/etc/nginx/privkey.pem;

    ssl_session_cache shared:SSL:20m;
    ssl_session_timeout 10m;

    ssl_prefer_server_ciphers on;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers
    ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;

    access_log /var/log/nginx/my_domain.access.log;

    add_header Strict-Transport-Security "max-age=31536000";
    client_max_body_size 512M;


    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 120s;

        proxy_pass http://NEXTCLOUD_IP;
    }

    location /.well-known/carddav {
        return 301 $scheme://$host/remote.php/dav;
    }

    location /.well-known/caldav {
        return 301 $scheme://$host/remote.php/dav;
    }
}

Apache Configuration

<VirtualHost INTERFACE IP:80>
    ServerName NEXTCLOUD_DOMAIN
    ServerAlias Nextcloud-http
    DocumentRoot "/usr/local/www/nextcloud"
    ErrorLog "/var/log/nextcloud-error_log"
    CustomLog "/var/log/nextcloud-access_log" common
    Protocols h2 http/1.1
</VirtualHost>

Which app?

Hi @socialdtk,
You are missing the required support template. Please fill this form out and edit into your post.

This will give us the technical info and logs needed to help you! Thanks.

Thanks! I added the requested information. The nextcloud.log was polluted with smtp errors which I corrected. I cleared log and did not see any new entries generated when attempting to access a text file via the WAN.

I believe the app that I am using is rich document editor? It came with the server. I did not have to enable it in the app store.

Does it work for other files?

Your apache logs show that the groceries list (first entry) was successfully delivered. Next thing, I’d go back the connection and checking nginx proxy and the firewall if the query passed as well or if it was blocked.

Maybe you can deactivate or delete pfsense. It is also not really needed. Only listen ports can be connected and i think you do not use tools like check ssl content. Also Nextcloud has got good security features. Why not use them? I think 2FA is far better than all you implement with pfsense.

I did a bit more digging and realized that text files do eventually open, they just take a VERY long time. I initially thought that they were not working at all because the screen on the iPhone would lock before the request completes.

In this example it takes me over 50 seconds to open a 108 byte file. All multimedia files open very quickly. This only seems to be effecting text files.

nginx logs

172.58.155.211 - bob [24/Jan/2023:09:54:02 -0500] "POST /ocs/v2.php/apps/files/api/v1/directEditing/open?path=/Documents/Notes/grocery-list.md&editorId=text HTTP/1.1" 200 202 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /index.php/apps/files/directEditing/E9QxX44bTGeMBFJPxxxrMMqkRNRMYf8HAQ2efTyrkR5FJYCqz3Xb3683yp9Qw2sQ HTTP/1.1" 200 4565 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /apps/theming/css/default.css?v=47354877-0 HTTP/1.1" 200 3251 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /dist/core-files_fileinfo.js?v=bfb7b0cc-0 HTTP/1.1" 200 928 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /index.php/core/js/oc.js?v=bfb7b0cc HTTP/1.1" 200 3685 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /dist/core-files_client.js?v=bfb7b0cc-0 HTTP/1.1" 200 12462 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /dist/files_sharing-main.js?v=bfb7b0cc-0 HTTP/1.1" 200 371 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /apps/theming/js/theming.js?v=bfb7b0cc-0 HTTP/1.1" 200 60 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /index.php/js/core/merged-template-prepend.js?v=bfb7b0cc-0 HTTP/1.1" 200 3098 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:03 -0500] "GET /index.php/apps/theming/theme/default.css?plain=1&v=b6589fc6 HTTP/1.1" 200 3021 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:04 -0500] "GET /index.php/apps/theming/theme/dark.css?plain=1&v=b6589fc6 HTTP/1.1" 200 2966 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:04 -0500] "GET /index.php/apps/theming/theme/light.css?plain=0&v=b6589fc6 HTTP/1.1" 200 3187 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:04 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:04 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 283 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:04 -0500] "GET /index.php/apps/theming/theme/dark.css?plain=0&v=b6589fc6 HTTP/1.1" 200 3131 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:04 -0500] "GET /index.php/apps/theming/theme/light-highcontrast.css?plain=0&v=b6589fc6 HTTP/1.1" 200 3474 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:04 -0500] "GET /index.php/apps/theming/theme/dark-highcontrast.css?plain=0&v=b6589fc6 HTTP/1.1" 200 3534 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:04 -0500] "GET /index.php/apps/theming/theme/opendyslexic.css?plain=0&v=b6589fc6 HTTP/1.1" 200 867 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:05 -0500] "GET /dist/core-main.js?v=bfb7b0cc-0 HTTP/1.1" 200 148452 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:05 -0500] "GET /core/css/server.css?v=bfb7b0cc-0 HTTP/1.1" 200 162364 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:06 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 283 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:06 -0500] "GET /apps/text/js/text-text.js?v=bfb7b0cc-0 HTTP/1.1" 200 137958 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:09 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 263 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:09 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:09 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:09 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 283 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:10 -0500] "GET /dist/icons.css HTTP/1.1" 200 217525 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:11 -0500] "GET /index.php/apps/theming/theme/light.css?plain=1&v=b6589fc6 HTTP/1.1" 200 3021 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:11 -0500] "GET /index.php/apps/theming/theme/light-highcontrast.css?plain=1&v=b6589fc6 HTTP/1.1" 200 3131 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:11 -0500] "GET /index.php/apps/theming/theme/dark-highcontrast.css?plain=1&v=b6589fc6 HTTP/1.1" 200 3174 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:11 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 283 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:14 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:15 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:15 -0500] "GET /core/img/app-background.jpg HTTP/1.1" 200 190294 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:15 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:15 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 283 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:17 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 283 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:20 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:20 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:21 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:21 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 283 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:22 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 283 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:26 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:26 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:26 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:26 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:26 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:28 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:31 -0500] "GET /dist/core-common.js?v=bfb7b0cc-0 HTTP/1.1" 200 14249367 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:31 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:31 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:31 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:32 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:32 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:34 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:36 -0500] "GET /dist/core-common.js?v=bfb7b0cc-0 HTTP/1.1" 200 14249367 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:36 -0500] "GET /apps/text/js/editor.js?v=078cfde4cee7a23bba6b HTTP/1.1" 200 398330 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:37 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:37 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 261 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:37 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:38 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:38 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 262 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:38 -0500] "GET /apps/text/js/editor.js?v=078cfde4cee7a23bba6b HTTP/1.1" 200 398330 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:39 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 284 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:41 -0500] "GET /apps/text/js/vendors.js?v=8a910986bb6e9386d2cd HTTP/1.1" 200 4124812 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:42 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 412 31 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:42 -0500] "GET /index.php/csrftoken HTTP/1.1" 200 123 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:42 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 559 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:42 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 286 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "GET /apps/text/js/editor-rich.js?v=a80764c1ba8d6cf4638f HTTP/1.1" 200 20627 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 264 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 286 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 260 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "GET /apps/text/js/editor-collab.js?v=dc931a1d206d4e41255a HTTP/1.1" 200 10525 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "GET /apps/text/js/vendors.js?v=8a910986bb6e9386d2cd HTTP/1.1" 200 4124812 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "POST /index.php/apps/text/session/push HTTP/1.1" 200 194 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 260 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 448 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:43 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 448 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:45 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 288 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"
172.58.155.211 - - [24/Jan/2023:09:54:45 -0500] "POST /index.php/apps/text/session/sync HTTP/1.1" 200 447 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.6.0 AppleWebKit/605.1.15 Mobile/15E148"

NextCloud is running on my home network which only has 1 public IP address. In this case PFSense is essential for NAT and to restrict access to my LAN.

The config is quite simple though in regards to NextCloud. All traffic on port 443 gets pass to nginx, which then passes it to the appropriate resource.

Your post is confusing me.

Are you using an actual text editing app for iOS pointed at your Nextcloud directory?

I deployed the latest NextCloud server Releases · nextcloud/server · GitHub

In the web UI there is a “+” button in the top left corner of the screen. When I click that button I am presented with a menu containing the following options [“Upload file”, “New folder,”, “New text file”, “Set up template folder”].

I click “New text file” which defaults to “{name}.md”. These are the files that I have trouble opening outside of my LAN.

Does this make sense? It seems very straight forward to me.

I’m looking for the name of the default NextCloud .txt/.md editor, but it is not immediately obvious in the UI. Going by the logs I believe it is text /apps/text/js/editor-rich.js.

I just found this GitHub - nextcloud/text: 📑 Collaborative document editing using Markdown. This is the app that I’m experiencing issues with.

I thnk there are a lot of alternatives. And yes you need it for NAT/Forwarding/Reverse Proxy but not for firewall.

After more investigation, I discovered that this problem only occurs on the iOS application. From a web browser, I can connect to my NextCloud environment and open markdown files using the Text app without issue.

Comparing the logs from the iOS app inside and outside of my network, the only difference that I notice is that network requests are missing response codes. For example, this request from my local network shows a 200.

2023-02-11 12:22:51 Network request started: GET https://office.test.cloud/status.php (200)

While the same request from outside my network does not.

2023-02-11 12:26:46 Network request started: GET https://office.test.cloud/status.php

With that said, in both instances the request is successful.

2023-02-11 12:26:46 Network response request: https://office.test.cloud/status.php, result: success(170 bytes)

I have been familiarizing myself with NextCloud code and will begin troubleshooting this in more detail. I will let everyone know if I am able to resolve the issue.

iOS application on Local Network

2023-02-11 12:22:51 [INFO] Application will enter in foreground
2023-02-11 12:22:51 Network request started: GET https://office.test.cloud/status.php (200)
2023-02-11 12:22:51 Network request started: GET https://office.test.cloud/ocs/v2.php/cloud/user (200)
2023-02-11 12:22:51 Network response request: https://office.test.cloud/status.php, result: success(170 bytes)
2023-02-11 12:22:51 Network response request: https://office.test.cloud/ocs/v2.php/cloud/user, result: success(1027 bytes)
2023-02-11 12:22:51 Network request started: PROPFIND https://office.test.cloud/remote.php/dav/files/tester/test
2023-02-11 12:22:51 Network response request: https://office.test.cloud/remote.php/dav/files/tester/test, result: success(1726 bytes)
2023-02-11 12:22:51 [INFO] Application did become active
2023-02-11 12:22:51 [INFO] Initialize Auto upload with 0 uploads
2023-02-11 12:22:51 Network request started: POST https://office.test.cloud/ocs/v2.php/apps/files/api/v1/directEditing/open?path=/test/grocery-list.md&editorId=text
2023-02-11 12:22:52 Network response request: https://office.test.cloud/ocs/v2.php/apps/files/api/v1/directEditing/open?path=/test/grocery-list.md&editorId=text, result: success(216 bytes)
2023-02-11 12:22:52 Network request started: REPORT https://office.test.cloud/remote.php/dav/files/tester (207)
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/index.php/avatar/tester/256 (304)
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/ocs/v1.php/cloud/capabilities (200)
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/ocs/v2.php/apps/dashboard/api/v1/widgets (200)
2023-02-11 12:22:52 Network response request: https://office.test.cloud/ocs/v2.php/apps/dashboard/api/v1/widgets, result: success(1267 bytes)
2023-02-11 12:22:52 Network response request: https://office.test.cloud/remote.php/dav/files/tester, result: success(156 bytes)
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/apps/files/img/app.svg
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/ocs/v2.php/apps/files_sharing/api/v1/shares?reshares=false&shared_with_me=false&subfiles=false
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/ocs/v2.php/apps/files/api/v1/directEditing
2023-02-11 12:22:52 Network response request: https://office.test.cloud/ocs/v2.php/apps/files/api/v1/directEditing, result: success(753 bytes)
2023-02-11 12:22:52 Network response request: https://office.test.cloud/ocs/v2.php/apps/files_sharing/api/v1/shares?reshares=false&shared_with_me=false&subfiles=false, result: success(1132 bytes)
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/ocs/v2.php/apps/user_status/api/v1/user_status (200)
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/apps/activity/img/activity-dark.svg (200)
2023-02-11 12:22:52 Network response request: https://office.test.cloud/ocs/v2.php/apps/user_status/api/v1/user_status, result: success(224 bytes)
2023-02-11 12:22:52 Network request started: GET https://office.test.cloud/apps/user_status/img/app-dark.svg
2023-02-11 12:22:52 Network request started: No request created yet.
2023-02-11 12:22:58 [INFO] Application will resign active
2023-02-11 12:23:00 [INFO] Application did enter in background
2023-02-11 12:23:00 [SUCCESS] Refresh task success submit request 60 seconds <BGAppRefreshTaskRequest: com.nextcloud.refreshTask, earliestBeginDate: 2023-02-11 17:24:00 +0000>
2023-02-11 12:23:00 [SUCCESS] Background Processing task success submit request 5 minutes <BGProcessingTaskRequest: com.nextcloud.processingTask, earliestBeginDate: 2023-02-11 17:28:00 +0000, requiresExternalPower=0, requiresNetworkConnectivity=0>

iOS Application on LTE Network

2023-02-11 12:26:46 [INFO] Application will enter in foreground
2023-02-11 12:26:46 Network request started: GET https://office.test.cloud/status.php
2023-02-11 12:26:46 Network request started: GET https://office.test.cloud/ocs/v2.php/cloud/user
2023-02-11 12:26:46 Network request started: PROPFIND https://office.test.cloud/remote.php/dav/files/tester/test
2023-02-11 12:26:46 [INFO] Application did become active
2023-02-11 12:26:46 [INFO] Initialize Auto upload with 0 uploads
2023-02-11 12:26:46 Network response request: https://office.test.cloud/status.php, result: success(170 bytes)
2023-02-11 12:26:46 Network response request: https://office.test.cloud/ocs/v2.php/cloud/user, result: success(1027 bytes)
2023-02-11 12:26:46 Network response request: https://office.test.cloud/remote.php/dav/files/tester/test, result: success(1726 bytes)
2023-02-11 12:26:47 Network request started: POST https://office.test.cloud/ocs/v2.php/apps/files/api/v1/directEditing/open?path=/test/grocery-list.md&editorId=text
2023-02-11 12:26:47 Network request started: No request created yet.
2023-02-11 12:26:47 Network request started: GET https://office.test.cloud/index.php/avatar/tester/256
2023-02-11 12:26:47 Network request started: No request created yet.
2023-02-11 12:26:47 Network request started: No request created yet.
2023-02-11 12:26:47 Network response request: https://office.test.cloud/ocs/v2.php/apps/files/api/v1/directEditing/open?path=/test/grocery-list.md&editorId=text, result: success(216 bytes)
2023-02-11 12:26:47 Network response request: https://office.test.cloud/remote.php/dav/files/tester, result: success(156 bytes)
2023-02-11 12:26:47 Network response request: https://office.test.cloud/ocs/v2.php/apps/dashboard/api/v1/widgets, result: success(1267 bytes)
2023-02-11 12:26:47 Network request started: GET https://office.test.cloud/ocs/v2.php/apps/files_sharing/api/v1/shares?reshares=false&shared_with_me=false&subfiles=false
2023-02-11 12:26:47 Network request started: GET https://office.test.cloud/ocs/v2.php/apps/files/api/v1/directEditing
2023-02-11 12:26:47 Network response request: https://office.test.cloud/ocs/v2.php/apps/files/api/v1/directEditing, result: success(753 bytes)
2023-02-11 12:26:47 Network response request: https://office.test.cloud/ocs/v2.php/apps/files_sharing/api/v1/shares?reshares=false&shared_with_me=false&subfiles=false, result: success(1132 bytes)
2023-02-11 12:26:47 Network request started: GET https://office.test.cloud/apps/user_status/img/app-dark.svg
2023-02-11 12:26:48 Network request started: GET https://office.test.cloud/ocs/v2.php/apps/user_status/api/v1/user_status
2023-02-11 12:26:48 Network request started: GET https://office.test.cloud/apps/files/img/app.svg
2023-02-11 12:26:48 Network response request: https://office.test.cloud/ocs/v2.php/apps/user_status/api/v1/user_status, result: success(224 bytes)
2023-02-11 12:26:48 Network request started: GET https://office.test.cloud/apps/calendar/img/calendar-dark.svg
2023-02-11 12:26:48 Network request started: GET https://office.test.cloud/apps/activity/img/activity-dark.svg
2023-02-11 12:27:24 [INFO] Application will resign active
2023-02-11 12:27:26 [INFO] Application did enter in background
2023-02-11 12:27:26 [SUCCESS] Refresh task success submit request 60 seconds <BGAppRefreshTaskRequest: com.nextcloud.refreshTask, earliestBeginDate: 2023-02-11 17:28:26 +0000>
2023-02-11 12:27:26 [SUCCESS] Background Processing task success submit request 5 minutes <BGProcessingTaskRequest: com.nextcloud.processingTask, earliestBeginDate: 2023-02-11 17:32:26 +0000, requiresExternalPower=0, requiresNetworkConnectivity=0>