diff --git a/README.md b/README.md index 5e5162e..345c00e 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,7 @@ Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an o To install and configure it: - Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server. - Install OnlyOffice application. That's the client part that will connect to an OnlyOffice server. -- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (an URL might be defined by default, but is not always correct). Please note the **`/index.php/`**. Keep others server parameters empty. Save it. -- You can also configure which file formats should be opened by OnlyOffice. +- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. *NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi, …) is **not** supported* diff --git a/README_fr.md b/README_fr.md index 1adf19e..a80bc2f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -38,8 +38,7 @@ Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. Pour l'installer et le configurer: - Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice. - Installez l'application *OnlyOffice*. C'est la partie cliente qui va se connecter au serveur OnlyOffice. - - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), vous devez le configurer avec l'URL suivante `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (une URL peut-être préremplie, mais elle n'est pas toujours correcte). Veuillez noter la présence de **`/index.php/`**. Laissez les autres paramètres vides. Sauvegardez. - - Vous pouvez aussi configurer quels formats de fichier s'ouvrent avec OnlyOffice. + - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. - Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. *NB: OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi, …) n'est **pas** supporté* diff --git a/conf/nginx.conf b/conf/nginx.conf index c4b73e1..09cc770 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -69,15 +69,15 @@ location ^~ __PATH__/ { access_log off; } - location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)/ { + location ~ ^\__PATH__\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { deny all; } - location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { + location ~ ^\__PATH__\/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } - location ~ ^__PATH__/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+)\.php(/.*|)$ { - fastcgi_split_path_info ^(.+?\.php)(/.*|)$; + location ~ ^\__PATH__\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; include fastcgi_params; @@ -92,10 +92,9 @@ location ^~ __PATH__/ { fastcgi_pass unix:/var/run/php/php__YNH_PHP_VERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; - fastcgi_param REMOTE_USER $remote_user; } - location ~ ^__PATH__/(?:updater|oc[ms]-provider)(?:$|/) { + location ~ ^\__PATH__\/(?:updater|oc[ms]-provider)(?:$|\/) { try_files $uri/ =404; index index.php; } @@ -116,10 +115,12 @@ location ^~ __PATH__/ { rewrite ^ __PATH__/index.php$request_uri; } + location ~* ^__PATH__/apps/documentserver_community/ { + rewrite ^ __PATH__/index.php$request_uri; + } - - # Adding the cache control header for js and css files - location ~ \.(?:css|js|woff2?|svg|gif)$ { + # Adding the cache control header for js, css and map files + location ~ ^\__PATH__\/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { try_files $uri __PATH__/index.php$request_uri; more_set_headers "Cache-Control: public, max-age=15778463"; # Add headers to serve security related headers @@ -129,13 +130,14 @@ location ^~ __PATH__/ { more_set_headers "X-Robots-Tag: none"; more_set_headers "X-Download-Options: noopen"; more_set_headers "X-Permitted-Cross-Domain-Policies: none"; + more_set_headers "X-Frame-Options: SAMEORIGIN"; more_set_headers "Referrer-Policy: no-referrer"; # Optional: Don't log access to assets access_log off; } - location ~* \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { + location ~ ^\__PATH__\/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { try_files $uri __PATH__/index.php$request_uri; # Optional: Don't log access to other assets access_log off;