47 Commits

Author SHA1 Message Date
Miłosz Kosobucki
b60a593f9e Add mp4 and webm to nginx config
Mp4 is used by the firstrun plugin. Without these being mentioned in
this section, the firstrun movie isn't shown and the first run modal
dialog apparently can't be closed.

Webm added for completeness as there are files like this in firstrun
assets.

Signed-off-by: Miłosz Kosobucki <milosz@kosobucki.pl>
2025-11-11 16:07:28 +01:00
Ferdinand Thiessen
ef403b4883 fix(nginx): fastcgi_request_buffering must be on
* resolves: https://github.com/nextcloud/documentation/issues/9574

Some clients like DAVx5 use chunked transfer encoding.
PHP-FPM does not support this[1] because it requires to comply with the
CGI standard - 20+ years old - which enforces a Content-Length header.

So we need to buffer the whole request until passing it to PHP-FPM.

Without this 0-byte files would be created on Nextcloud as PHP-FPM will
not only set content-length to 0 but also does not pass the body data
stream.

[1] https://bugs.php.net/bug.php?id=51191 and https://github.com/php/php-src/pull/7509

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-04 12:23:17 +02:00
as598466
1647f1787b improve nginx conf examples to mention php-fpm timeouts
When uploading large files, a 504 error occurs in the Nextcloud client: "It’s taking too long to connect to the server. Please try again later. If you need help, contact your server administrator. Add the appropriate directives to prevent this error.

Signed-off-by: as598466 <124391092+as598466@users.noreply.github.com>
Signed-off-by: Simon L. <szaimen@e.mail.de>
Co-Authored-By: Simon L. <szaimen@e.mail.de>
2025-08-26 11:41:36 +02:00
Julien Veyssier
8486c74c57 enh(admin): comment timeout configs in nginx-root-sample and nginx-subdir.conf.sample
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-04 14:18:38 +02:00
Julien Veyssier
7f4243222e enh(admin): add more timeout configs in the nginx-root-sample and nginx-subdir.conf.sample files
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-04 14:14:27 +02:00
MichaIng
6d820f08fd docs(admin): remove X-XSS-Protection header from Nginx assets
It was removed from the config in #9188, but forgotten for the static assets block.

In addition, the date added with #12100 was is added to the subdir config as well, for consistency.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-07-23 13:06:26 +02:00
Maru Alka
669ebf6b80 Disable XSS-Protection Header
see notes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection

Signed-off-by: Maru Alka <me@marco-alka.de>
2025-06-30 21:39:30 +02:00
MichaIng
4ad9e7c36e nginx-subdir: Align HSTS directive with root config
Signed-off-by: MichaIng <micha@dietpi.com>
2025-05-05 13:21:16 +02:00
Joas Schilling
448e416a6b fix(admin): Document oft loading for nginx
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-10-11 08:42:25 +02:00
Istvan Berenyi
dc56b80a4d Update nginx-subdir.conf.sample
Signed-off-by: Istvan Berenyi <39776299+istvan-berenyi@users.noreply.github.com>
2024-09-11 17:39:35 +01:00
Istvan Berenyi
84410d1ced Update nginx-subdir.conf.sample
Updated Nginx subdir conf file with new formatting of http2

Signed-off-by: Istvan Berenyi <39776299+istvan-berenyi@users.noreply.github.com>
2024-09-10 19:02:36 +01:00
Ferdinand Thiessen
64cfff1db8 feat(admin): Add note about webp static assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-07-17 14:03:01 +02:00
Adriano Cataluddi
04212e19ca Removed the duplicate extension "js" warning from the NGINX configuration. Fixed #1
Signed-off-by: Adriano Cataluddi <acataluddi@gmail.com>
2024-04-28 16:29:01 +02:00
Dominic Giebert
1f9ef63cd9 Added support for Built-in CODE Server (ARM64)
Signed-off-by: Dominic Giebert <dominic.giebert@suse.com>
2024-02-28 17:46:51 +01:00
MichaIng
4ef607d350 nginx: fix response headers for assets
Nginx resets all response headers in a location block, if it contains any "add_header" directive. When setting the "Cache-Control" header for static assets, this was originally worked around by using the "expires" directive instead. https://github.com/nextcloud/documentation/pull/8083 however added the "immutable" flag for assets with "v=" query parameter and broke all other response headers for assets that way.

This commit fixes this by re-adding all reponse headers explicitly for those assets. Originally those doubled code was removed thanks to using "expires", but I see no way to have both: the "immutable" flag as well as avoiding doubled headers via "expires" directive.

Additionally, this commit avoids the trailing comma and space in the Cache-Control header for assets without "v=" query parameter, and adds sets the wasm MIME type in a cleaner/more consistent way together with js/mjs, and rephrases the broken comment sentence.

Signed-off-by: MichaIng <micha@dietpi.com>
2024-01-26 17:10:58 +01:00
Josh Richards
371e73756f Merge pull request #11287 from nextcloud/fix/nginx-fpm
Update NGINX example to the recommended PHP version
2023-11-21 19:30:28 -05:00
Marcel Müller
d35ab2c065 Adjust nginx configuration for .ogg and .flac files
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
2023-11-16 17:02:52 +01:00
anoy.
84605852ee fix typo in comment
Signed-off-by: anoy. <anoymouserver+github@mailbox.org>
2023-11-15 18:25:52 +01:00
anoy.
bbb328119e use recommended php version
Signed-off-by: anoy. <anoymouserver+github@mailbox.org>
2023-11-15 18:22:53 +01:00
Daniel
59ad6457ca Merge pull request #11162 from am97/patch/1 2023-10-14 16:16:13 +02:00
Arthur Schiwon
dc0b8d9c39 fix(nginx): adjust config to changed ocm-provider
- Since 27.1.2 and 26.0.8 ocm-provider is not a dir anymore, but
  implemented in a usual Controller. Nginx webserver config requires
  adjustemnts.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-10-05 11:50:52 +02:00
Andrés Maldonado
e543bec9ba Remove legacy header X-Download-Options
The header has been removed from the nextcloud/server code: ea0e45d81e

Signed-off-by: Andrés Maldonado <maldonado@codelutin.com>
2023-10-01 23:50:48 +02:00
Christoph Wurst
2cdaa2bbc5 Merge branch 'master' into master 2023-06-26 09:11:54 +02:00
Ferdinand Thiessen
6622bdbb87 fix(admin_manual): Add module js (mjs) as static resource to nginx config
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2023-06-07 15:13:46 +02:00
Florian Diwald
b1542a7512 Merge 'nextcloud/master' 2023-05-27 11:03:05 +02:00
Ferdinand Thiessen
1ef2afca31 fix(admin): Nginx: Change mimetype from application/javascript to text/javascript
* See also https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#textjavascript

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2023-05-15 12:30:40 +02:00
Ferdinand Thiessen
c1c9b0a072 Adjust nginx configuration to support mjs for javascript
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2023-03-16 15:47:37 +01:00
MichaIng
10d9cc6a79 Replace X-Robots-Tag header value with "noindex, nofollow"
For reference: https://github.com/nextcloud/server/pull/36689

Signed-off-by: MichaIng <micha@dietpi.com>
2023-02-15 17:49:55 +01:00
langj
c3a1e6f0b6 remove invalid trailing semicolon from hsts header
Signed-off-by: langj <langj@cs.tum.edu>
2022-07-24 23:53:32 +02:00
Carl Schwan
9c0e018f18 Improve Upload speed with nginx
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-19 16:33:35 +02:00
Jan Kiesewetter
261d6dafe4 Prevent nginx HTTP Server Detection
Signed-off-by: Jan Kiesewetter <jan@t3easy.de>
2022-03-02 11:41:17 +01:00
Joas Schilling
378e79537b Merge pull request #8083 from nextcloud/nginx-immuatable-cache3
fix nginx cache immutable example
2022-02-25 08:37:46 +01:00
Julius Härtl
3b33f6a04e Merge pull request #8095 from nextcloud/fix/mapfiles-nginx
Add mapfile serving for nginx conf examples
2022-02-24 09:14:41 +01:00
John Molakvoæ
39e804304a Merge pull request #6955 from ChristianTacke/pr/nginx_reorder 2022-02-24 09:12:33 +01:00
John Molakvoæ
fdb5e1ff95 Update nginx-subdir.conf.sample 2022-02-24 09:09:28 +01:00
Robin Appelman
d70354d7bd fix nginx cache immutable example 2022-02-21 15:34:54 +01:00
Carl Schwan
b30299c32d Add documentation for cache control immutable
See https://github.com/nextcloud/server/pull/31141/files

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-02-14 16:02:08 +01:00
Carl Schwan
95ef427295 Ensure that nginx config sample allow downloading big file
"fastcgi_max_temp_file_size 0;" makes it possible to download file
bigger than 1GB. See https://help.nextcloud.com/t/synchronization-impossible-on-files-larger-than-1gb/66323/2

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-21 13:03:08 +01:00
Christian Tacke
44016fb4ae Reorder nginx config sample
Move the `root` directive more to the top. That way all the
fields that need to be changed are in one place.

Signed-off-by: Christian Tacke <8560110+ChristianTacke@users.noreply.github.com>
2022-01-08 16:05:12 +01:00
Daniel Calviño Sánchez
eb73b789bb Allow to serve static WebAssembly and TensorFlow Lite files
Since Talk 13 (and thus Nextcloud 23) WebAssembly (.wasm) and TensorFlow
Lite (.tflite) files need to be loaded from the web server to provide
certain features (like the background blur in the WebUI).

Those files can be treated in a similar way to other static resources,
and there should not be any problem caching or compressing them.
However, as compressed TensorFlow Lite files are only ~12% smaller,
the compression directive depends on the MIME type and there is no
standard MIME type for TensorFlow Lite files, for now only WebAssembly
files are compressed.

Depending on the setup "application/wasm" may not be associated with
".wasm" files, so the directive was added just in case, as the
compression is enabled through the MIME type and, besides that, the
browsers log a warning if the expected MIME type is not returned.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-11-17 13:06:58 +01:00
Jérôme Lebleu
87f631262e Fix PHP's rewrite rule in NGINX subdir.conf.sample
Signed-off-by: Jérôme Lebleu <jeromelebleu@users.noreply.github.com>
2021-10-11 18:00:16 +02:00
Daniel
3052f07ddc Merge pull request #6746 from simonspa/nginx-timeout
nginx: increase client_body_timeout
2021-10-10 11:12:09 +02:00
Christoph Wurst
87fab7a8df Fix legacy routes like ajax.php on nginx
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-09-24 15:59:54 +02:00
MichaIng
68d8d75d9f Align Nginx configuration with Apache2 .htaccess
As of: https://github.com/nextcloud/server/pull/27835

Signed-off-by: MichaIng <micha@dietpi.com>
2021-07-09 13:22:56 +02:00
simonspa
583321f3a9 Update nginx-root.conf.sample
Signed-off-by: Simon Spannagel <simonspa@kth.se>
2021-06-07 19:02:57 +02:00
Florian Diwald
698b25e5b5 fix HSTS header in nginx subdir configuration
Signed-off-by: Florian Diwald <fdiwald@hotmail.com>
2021-04-18 14:47:46 +02:00
MichaIng
9178d3b898 Fix Nginx .well-known redirects (#6221)
- Follow the .htaccess and exclude .well-known redirects for ACME challenges and PKI validation, which are not handled by Nextcloud, and handle requests for `/remote`
- Preserve the query string when redirecting .well-known URIs.
- Separate the example config files from nginx.rst

Signed-off-by: MichaIng <micha@dietpi.com>
2021-04-07 23:21:21 +01:00