Skip to content

Commit

Permalink
sync with upstream nextcloud docs. closes linuxserver#391
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin-li-developer authored Dec 22, 2023
1 parent ba7913a commit ceb60ef
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions root/defaults/nginx/site-confs/default.conf.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## Version 2023/06/23 - Changelog: https://github.com/linuxserver/docker-nextcloud/commits/master/root/defaults/nginx/site-confs/default.conf.sample
## Version 2023/12/22 - Changelog: https://github.com/linuxserver/docker-nextcloud/commits/master/root/defaults/nginx/site-confs/default.conf.sample

upstream php-handler {
server 127.0.0.1:9000;
#server unix:/run/php/php8.2-fpm.sock;
}

# Set the `immutable` cache control options only for assets with a cache busting `v` argument
map $arg_v $asset_immutable {
Expand Down Expand Up @@ -59,6 +65,15 @@ server {
# Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By;

# Add .mjs as a file extension for javascript
# Either include it in the default mime.types list
# or include you can include that list explicitly and add the file extension
# only for Nextcloud like below:
include mime.types;
types {
text/javascript js mjs;
}

# Specify how to handle directories -- specifying `/index.php$request_uri`
# here as the fallback means that Nginx always exhibits the desired behaviour
# when a client requests a path that corresponds to a directory that exists
Expand Down Expand Up @@ -126,15 +141,15 @@ server {

fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice
fastcgi_param front_controller_active true; # Enable pretty urls
fastcgi_pass 127.0.0.1:9000;
fastcgi_pass php-handler;

fastcgi_intercept_errors on;
fastcgi_request_buffering off;

fastcgi_max_temp_file_size 0;
}

location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ {
location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463, $asset_immutable";
access_log off; # Optional: Don't log access to assets
Expand Down

0 comments on commit ceb60ef

Please sign in to comment.