I have no support/technical question and have seen the support category. (Be aware that direct support questions will be deleted.)
on
Which general topic do you have
Hi,
I have a self-hosted Nextcloud instance running on Ubuntu Server with the following stack:
Web server: Nginx
PHP: 8.3 (php-fpm via unix socket)
Database: MariaDB
Nextcloud installed manually (not Docker)
HTTPS working with Let’s Encrypt
Domain: cloudvictoria.duckdns.org
The instance is accessible from both LAN and internet, and login works correctly.
However, I’m experiencing the following issues:
PROBLEMS:
Files are not previewed:
JPG, PNG, PDF, TXT files are downloaded instead of being displayed in the browser
The built-in viewer does not work
Some apps are broken:
“Photos” shows empty content
“Activity” does not load data
“Files” app lists files correctly
Nextcloud admin panel shows warnings:
Issue with “/ocs-provider/” not resolving correctly
Missing HTTP headers warnings
JavaScript / MIME related warnings
WHAT I HAVE VERIFIED:
MIME types are correctly configured in Nginx (image/png, etc.)
Viewer apps are installed and enabled:
files_pdfviewer
viewer
HTTPS is properly configured
trusted_domains and overwrite settings are set correctly in config.php
PHP-FPM is working via socket (/run/php/php8.3-fpm.sock)
Permissions are correct (www-data owns Nextcloud directory)
SYMPTOMS:
Clicking a file triggers download instead of preview
Internal Nextcloud apps relying on OCS endpoints seem broken
It looks like routing or rewrite rules are not fully correct
MY SUSPICION:
This might be related to an incomplete or incorrect Nginx configuration (rewrite rules, location blocks, or handling of index.php and OCS endpoints).
REQUEST:
Can someone provide a minimal, working Nginx configuration for Nextcloud (PHP-FPM)?
What specific Nginx rules are required for:
proper file previews
OCS endpoints (/ocs-provider/)
internal app functionality (Photos, Activity)
How can I verify if requests are correctly routed through index.php?
If needed, I can provide my current Nginx configuration and logs.
Thanks in advance.